Raw file data received from the server. For more information, see Open Cloud Files API.
HTTP client instance used to send requests to the REST API server.
Endpoint-specific HTTP headers for the GET
, POST
, PUT
and DELETE
requests. You can add
custom headers at any time.
Endpoint API path relative to the REST API server URL.
Active version number of the file.
File creation time (UTC) in the format specified in ISO 8601.
File custom fields object, to store custom data.
Raw file data received from the server. For more information, see Open Cloud Files API.
Returns a list of file formats in which the active version of the file was exported.
To export file to one of the supported formats create File Converter job using createJob(). To download exported file use downloadResource().
For an example of exporting files to other formats, see the downloadResource help.
Geometry data type of the active file version. Can be one of:
vsfx
- VSFX
format, file can be opened in VisualizeJS
viewer.gltf
- glTF
format, file can be opened in Three.js
viewer.Returns an empty string if geometry data has not yet been converted. A files without geometry data can be exported to other formas, but cannot be opened in viewer.
Unique file ID.
Returns true
if the source file of the active file version has been deleted.
A files with deleted source file can be opened in the viewer, but cannot be exported to other formats.
File name, including the extension.
If the file is a version, then returns the ID of the original file. Otherwise, returns the file ID.
File owner information.
File preview image URL or empty string if the file does not have a preview. Use setPreview() to change preview image.
File shared link token or null
if file is not shared yet.
The size of the active version of the file in bytes.
Total size of all versions of the file in bytes.
Data status of the active version of the file. Contains:
geometry
- status of geometry data of vsfx
type.geometryGltf
- status of geometry data of gltf
type.properties
- status of properties.validation
- status of validation.Each status entity is a record with properties:
state
- Data state. Can be none
, waiting
, inprogress
, done
or failed
.jobId
- Unique ID of the data job.File type, matches the file extension (includes dot).
File last update time (UTC) in the format specified in ISO 8601.
Information about the user who made the last update.
Zero-based file version number for version files. The original file has version 0
.
List of the file versions.
Runs a new job on the server for the active version of the file.
The job type. Can be one of:
geometry
- Convert file geometry data to VSFX
format suitable for VisualizeJS
viewer.geometryGltf
- Convert file geometry data to glTF
format suitable for Three.js
viewer.properties
- Extract file properties.validation
- Validate the file. Only for IFC
files.dwg
, obj
, gltf
, glb
, vsf
, pdf
, 3dpdf
- Export file to the one of the supported format.
Use exports() to get the list of completed file exports. Use
downloadResource() to download the exported file.Optional
parameters: string | objectParameters for the job runner. Can be given as command line arguments for the
File Converter tool in form --arg=value
.
Creates a new file permission for a user, project, or group.
Actions are allowed to be performed on a file with this permission:
read
- The ability to read file description, geometry data and properties.readSourceFile
- The ability to download source file.write
- The ability to modify file name, description and references.readViewpoint
- The ability to read file viewpoints.createViewpoint
- The ability to create file viewpoints.A list of entities that will get access to the file.
Specifies whether all users have access to the file or not.
Creates a file shared link.
Optional
permissions: ISharedLinkPermissionsShare permissions.
Deletes a file and all its versions from the server.
You cannot delete a version file using delete()
, only the original file. To delete a version file
use deleteVersion().
Returns the raw data of a deleted file. For more information, see Open Cloud Files API.
Removes the specified permission from the file.
Permission ID.
Returns the raw data of a deleted permission. For more information, see Open Cloud File Permissions API.
Deletes the file shared link.
Returns the raw data of a deleted shared link. For more information, see Open Cloud SharedLinks API.
Deletes the specified version file.
Version to delete.
Returns the raw data of a deleted version file. For more information, see Open Cloud Files API.
Deletes the specified file viewpoint.
Viewpoint GUID.
Returns the raw data of a deleted viewpoint. For more information, see Open Cloud File Viewpoints API.
Downloads the source file of active version of the file from the server.
Optional
onProgress: (progress: number) => voidDownload progress callback.
Optional
signal: AbortSignalAn AbortController signal. Allows to communicate with a fetch request and abort it if desired.
Deprecated since 25.3
. Use downloadResourceRange() instead.
Optional
onProgress: (progress: number, downloaded: Uint8Array, requestId: number) => voidOptional
signal: AbortSignalDownloads a resource file of the active version of the file. Resource files are files that contain model scene descriptions, or geometry data, or exported files.
Resource file name.
Optional
onProgress: (progress: number, chunk: Uint8Array) => voidDownload progress callback.
Optional
signal: AbortSignalAn AbortController signal. Allows to communicate with a fetch request and abort it if desired.
const job = await file.crateJob("dwg");
await job.waitForDone();
const dwgFileName = file.exports.find((x) => x.endsWith(".dwg"));
const arrayBuffer = await file.downloadResource(dwgFileName);
const blob = new Blob([arrayBuffer]);
const fileName = file.name + ".dwg";
FileSaver.saveAs(blob, fileName);
Downloads a part of resource file of the active version of the file. Resource files are files that contain model scene descriptions, or geometry data, or exported files.
Resource file name.
Request ID for download progress callback.
A range of resource file contents to download.
Optional
onProgress: (progress: number, chunk: Uint8Array, requestId: number) => voidDownload progress callback.
Optional
signal: AbortSignalAn AbortController signal. Allows to communicate with a fetch request and abort it if desired.
Runs a job to convert geometry data of active version of the file. This is alias to createJob("geometry").
Optional
type: stringGeometry data type. Can be one of:
vsfx
- VSFX
format (default), for opening a file in VisualizeJS
viewer.gltf
- glTF
format, for opening a file in Three.js
viewer.Optional
parameters: string | objectParameters for the job runner. Can be given as command line arguments for the
File Converter tool in form --arg=value
.
Runs a job to extract properties of the active version of the file. This is alias to createJob("properties").
Optional
parameters: string | objectParameters for the job runner. Can be given as command line arguments for the
File Converter tool in form --arg=value
.
Returns information about specified file permission.
Permission ID.
Returns a list of file permissions.
Returns the properties for an objects in the active version of the file.
Optional
handles: string | string[]Object original handle or handles array. Specify undefined
to get properties for
all objects in the file.
Returns a list of file references.
References are images, fonts, or any other files to correct rendering of the file.
Optional
signal: AbortSignalAn AbortController signal, which can be used to abort waiting as desired.
Returns information about the file shared link or undefined
if file is not shared.
Returns viewpoint snapshot as base64-encoded Data URL.
Viewpoint GUID.
Returns a list of file viewpoints. For more information, see Open Cloud File Viewpoints API.
Deprecated since 25.3
. Use downloadResource() instead.
Optional
onProgress: (progress: number, downloaded: Uint8Array) => voidOptional
signal: AbortSignalSaves a new file viewpoint to the server. To create a viewpoint use Viewer.createViewpoint()
.
Viewpoint object. For more information, see Open Cloud File Viewpoints API.
Returns the list of original handles for an objects in the active version of the file that match the specified patterns. Search patterns may be combined using query operators.
Search pattern or combination of the patterns, see example below.
Sets or removes the file preview.
Optional
image: BodyInitPreview image. Can be a
Data URL string,
ArrayBuffer,
Blob or
Web API File object. Setting the image
to null
will remove the preview.
Sets the file references.
References are images, fonts, or any other files to correct rendering of the file. Reference files must be uploaded to the server before they can be assigned to the current file.
File references.
Updates file data on the server.
Raw file data. For more information, see Open Cloud Files API.
Uploads the new version of the file to the server, convert the geometry data and extract properties as needed.
Web API File object are
generally retrieved from a FileList
object returned as a result of a user selecting files using the HTML <input>
element.
An object containing upload parameters.
Optional
geometry?: booleanCreate job to convert file geometry data. The geometry data type is the same as the original file.
Optional
interval?: numberThe time, in milliseconds, the function should delay in between checking jobs status.
Optional
onProgress?: (progress: number, file: File) => voidUpload progress callback.
Optional
properties?: booleanCreate job to extract file properties.
Optional
signal?: AbortSignalAn AbortController signal, which can be used to abort waiting as desired.
Optional
timeout?: numberThe time, in milliseconds that the function should wait jobs. If no one jobs
are done during this time, the TimeoutError
exception will be thrown.
Optional
waitForDone?: booleanWait for geometry and properties jobs to complete.
Makes the given version active on client side. Does not change the active file version on the server.
This version change will affect the result:
Other clients will still continue to use the current active version of the file. Use undefined
to
revert back to the active version.
You need to reload the file data using checkout() to match the size and status fields to the version you selected.
Optional
version: numberRuns a job to validate the active version of the file. This is alias to createJob("validation").
To get validation report use downloadResource("validation_report.json").
Optional
parameters: string | objectParameters for the job runner. Can be given as command line arguments for the
File Converter tool in form --arg=value
.
Waits for jobs of the active version of the file to be done. Job is done when it changes to none
,
done
or failed
status.
Job or job array to wait on. Can be geometry
, geometryGltf
, properties
,
validation
, dwg
, obj
, gltf
, glb
, vsf
, pdf
, 3dpdf
or custom job name.
Optional
waitAll: booleanIf this parameter is true
, the function returns when all the specified jobs have
done. If false
, the function returns when any one of the jobs are done.
Optional
params: {An object containing waiting parameters.
Optional
interval?: numberThe time, in milliseconds, the function should delay in between checking jobs status.
Optional
onCheckout?: (file: File, ready: boolean) => booleanWaiting progress callback. Return true
to cancel waiting.
Optional
signal?: AbortSignalAn AbortController signal, which can be used to abort waiting as desired.
Optional
timeout?: numberThe time, in milliseconds that the function should wait jobs. If no one jobs
are done during this time, the TimeoutError
exception will be thrown.
Provides properties and methods for obtaining information about a file on the Open Cloud Server and managing its data and versions.