TagoIO SDK for JavaScript and TypeScript
    Preparing search index...

    Class Files

    Hierarchy

    Index

    Constructors

    Methods

    • Parameters

      • filename: string
      • uploadID: string
      • partNumber: number
      • blob: Blob
      • Optionaloptions: UploadOptions

      Returns Promise<{ ETag: string; PartNumber: number }>

      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.

    • Parameters

      • filename: string
      • uploadID: string
      • parts: { ETag: string; PartNumber: number }[]
      • Optionaloptions: UploadOptions

      Returns Promise<{ file: string }>

      Finishes a multipart upload instance

    • Parameters

      • filename: string
      • uploadID: string
      • part: number
      • fileBlob: Blob
      • Optionaloptions: UploadOptions

      Returns Promise<{ ETag: string; PartNumber: number }>

      Uploads a single part to TagoIO

    • Parameters

      • file: Blob | Buffer<ArrayBufferLike>
      • filename: string
      • Optionaloptions: UploadOptions

      Returns Promise<{ file: string }>

      Uploads 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