Optional
options: UploadOptionsOptional
options: UploadOptionsOptional
options: UploadOptionshttps://help.tago.io/portal/en/kb/articles/140-uploading-files Uploading Files
Optional
options: UploadOptionsUploads a single file to TagoIO using multipart upload. The file is divided into chunks and uploaded in parallel for better performance.
If receive an error "Authorization Denied", check policy File / Upload in Access Management.
const file = Buffer.from("file content");
const result = await Resources.files.uploadFile(file, "/uploads/myfile.txt", {
chunkSize: 5 * 1024 * 1024, // 5MB chunks
onProgress: (progress) => console.log(`Upload progress: ${progress}%`)
});
console.log(result.file); // https://api.tago.io/file/.../uploads/myfile.txt
Description
Adds an upload to the queue. It will try to upload for 'opts.maxTriesForEachChunk' and fail if it couldn't upload after those many tries.