Files
Uploading and managing files.
The sample code on this page is based on the same assumptions
Managing Files
To place a file in the Store, you need to create a file handle using the createFile(...)
function. The function accepts a StoreId
,
public and private metadata,the total size of the file that will be uploaded, and set up a flag that tells whether the file has the random write feature enabled.
Then you need to call writeToFile(...)
providing the created file handle and a portion of data to write. For small files, you can write the entire file with one request. For large files, it's more optimal to write them piece by piece, loading them in portions, for example from the disk, and then calling writeToFile(...)
on each piece.
To complete the entire file upload process - call closeFile(...)
with the file handle as a parameter.
A detailed code sample of how to upload (stream) a large file can be found here.
Modifying Files
File modification can be considered in two categories:
- Modifying file information.
- Modifying data in the file.
To update information about a file, you need to use the updateFileMeta(...)
.
Deleting a File
To delete a file, you need to use the deleteFile(...)
method.
We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.