Autodesk Creative Platform Runtime Library Version 1.5.0
Implicit Capabilities and Client-Side Runtime

File Overview

Represents an abstraction of a user-supplied file.

Introduced in Version: 1.4.0

Class Member Summary

Class Member Details

• File (fileparametervalue) | Constructor

The following parameters can be specified in the constructor:
  • fileparametervalue: FileJSON - Input File JSON

String name | Read Only

Represents the name of the file - i.e. Model.obj, Model.mtl, Model.jpg. This property is intended to be consistent with https://developer.mozilla.org/en-US/docs/Web/API/File.name.

• readAsDataView (callback) | Asynchronous

This function allows the client to access the binary data in the file via an asynchronous callback. This is similar to the Library.resourceDataView for resources.

  • callback: Function ( DataView ) - A function that is called with a view of the resource once loaded.

• readAsText (callback) | Asynchronous

This function allows the client to access the text in the file via an asynchronous callback. This is similar to the Library.resourceText for resources.
Comparable to https://developer.mozilla.org/en-US/docs/Web/API/FileReader.readAsText.

  • callback: Function ( String ) - A function that is called with a view of the resource once loaded.

JSON toJSON()

Returns the JSON representation of the object that can be serialized. The resulting JSON can be passed into the constructor later on to reconstruct the object.