Drive Files: Overview of Methods

You can store text documents, spreadsheets, presentations, images, and other information on Drive. Users can upload, edit, copy files, and configure access permissions for them.

Quick navigation: all methods

How to Manage Files

A new file should be uploaded using the disk.folder.uploadfile method to a folder by its identifier.

You can change the location of files within the Drive structure: move them using the disk.file.moveto method or copy them to other folders using the disk.file.copyto method.

You can retrieve file field values using the disk.file.get method. For example, to check if a file has been moved to the trash.

You can rename a file using the disk.file.rename method.

File Versions

You can obtain a list of file versions using the disk.file.getVersions method. This method uses the file identifier as a parameter.

To get information about a version, use the disk.version.get method. This method takes a parameter with the version identifier, not the file identifier.

Drive tools allow you to restore the desired version of a file. This is done using the disk.file.restoreFromVersion method.

You can upload a new version of a file using the disk.file.uploadversion method.

Access for External Users

To provide access to a file for an external user, you need to create a public link. This will allow you to share the file with people who do not have access to Bitrix24. You can obtain a public link for a file using the disk.file.getExternalLink method.

How to Delete Files

Files can be moved to the trash using the disk.file.markdeleted method. Deleted files can be restored using the disk.file.restore method within 30 days.

To permanently delete a file without the possibility of recovery, you need to use the disk.file.delete method. This will destroy the file forever.

User Documentation

Overview of Methods

Scope: disk

Who can execute the method: any user

Method

Description

disk.file.getfields

Returns the description of file fields

disk.file.get

Returns the file by identifier

disk.file.rename

Renames the file

disk.file.copyto

Copies the file to the specified folder

disk.file.moveto

Moves the file to the specified folder

disk.file.delete

Deletes the file forever

disk.file.markdeleted

Moves the file to the trash

disk.file.restore

Restores the file from the trash

disk.file.uploadversion

Uploads a new version of the file

disk.file.getVersions

Returns the list of file versions

disk.file.restoreFromVersion

Restores the file from a specific version

disk.file.getExternalLink

Returns a public link to the file