Class Files

Hierarchy

Index

Constructors

constructor

Methods

_addToQueue

  • _addToQueue(filename: string, uploadID: GenericID, partNumber: number, blob: Buffer | Blob, options: Options): Promise<{ ETag: any; 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

      the path + filename for the file

    • uploadID: GenericID

      the upload ID acquired by the 'createMultipartUpload' function call

    • partNumber: number
    • blob: Buffer | Blob

      the portion of the file to be uploaded

    • options: Options

      see the uploadFile function

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

_completeMultipartUpload

  • _completeMultipartUpload(filename: string, uploadID: string, parts: { ETag: String; PartNumber: number }[], options: Options): Promise<void>
  • Finishes a multipart upload instance

    Parameters

    • filename: string

      the path + filename for the file

    • uploadID: string

      the upload ID acquired by the 'createMultipartUpload' function call

    • parts: { ETag: String; PartNumber: number }[]

      all the parts uploaded to the file

    • options: Options

      the upload options for this file

    Returns Promise<void>

_uploadPart

  • _uploadPart(filename: string, uploadID: string, partNumber: number, blob: Buffer | Blob, options: Options): Promise<{ ETag: any; PartNumber: number }>
  • Uploads a single part to TagoIO

    Parameters

    • filename: string

      the path + filename for the file

    • uploadID: string

      the upload ID acquired by the 'createMultipartUpload' function call

    • partNumber: number

      the sequential part number for the upload. This should be 1 in the first call, then 2 in the second call, so on and so forth

    • blob: Buffer | Blob

      the portion of the file to be uploaded

    • options: Options

      the upload options for this file

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

changePermission

checkPermission

  • checkPermission(file: string): Promise<{ public: boolean }>
  • Check if file is private or public

    Parameters

    • file: string

      Path of file

    Returns Promise<{ public: boolean }>

delete

  • delete(files: string[]): Promise<string>
  • Delete Folder or Files

    Parameters

    • files: string[]

      An array of files or folders to be deleted

    Returns Promise<string>

getFileMD5

  • getFileMD5(url: string): Promise<string>
  • Get file md5 with authenticate token for privates files

    Parameters

    • url: string

      Full TagoIO File url

    Returns Promise<string>

getFileURLSigned

  • getFileURLSigned(url: string): Promise<string>
  • Get a file url with authenticate token valid for 120 seconds

    Parameters

    • url: string

      Full TagoIO File url

    Returns Promise<string>

list

move

  • move(fileList: MoveFiles[]): Promise<string>
  • Move/Rename Files

    example
    fileList: [
      {
        from: "/myfiles/myOldName.ext",
        to: "/myfiles/newFolder/andNewName.ext"
      }
    ]

    Parameters

    • fileList: MoveFiles[]

      Array move actions to be made

    Returns Promise<string>

uploadBase64

  • uploadBase64(fileList: Base64File[]): Promise<string>
  • Upload an array of files(Base64) to TagoIO The filename parameter is also full path

    example
    fileList: [
      {
        filename: "/myfiles/myfile.ext",
        file: "StringWithBase64"
      }
    ]

    Parameters

    • fileList: Base64File[]

      Array of files data to be uploaded

    Returns Promise<string>

uploadFile

  • uploadFile(file: Buffer | Blob, filename: string, options: Options): Promise<void>
  • Uploads a single file to TagoIO. The upload is multipart, meaning that the file will be divided and sent in chunks, resulting in multiple requests being made.

    Parameters

    • file: Buffer | Blob

      the file to be uploaded

    • filename: string

      the path + filename for the file

    • options: Options

      the upload options for this file

    Returns Promise<void>