Taficloud-js-sdk is a simple library for uploading, downloading, and merging files using JavaScript. It supports authenticated requests with API keys and is designed to be easily integrated into web applications.
Taficloud
class with your API key. The API key will be used in the Authorization
header for authenticated requests.
uploadFile
method. This method takes a file (as a File
or Blob
object), a fileName
, and a url
. Optionally, you can specify a folder
.
downloadFile
method. This method will initiate a file download.
mergeFiles
method. It takes an array of File
or Blob
objects and returns a merged file.
constructor(apiKey: string)
Taficloud
class with the provided API key.
apiKey
: The API key used for authorization in requests.uploadFile(file: File | Blob, fileName: string, folder?: string): Promise<any>
file
: The file to be uploaded (as a File
or Blob
object).fileName
: The name of the file.folder
(optional): The folder where the file should be uploaded.Promise
that resolves with the server’s response or rejects with an error.
downloadFile(url: string): Promise<File>
url
: The url of the file to download.Promise
that resolves with the downloaded file.
mergeFiles(files: (File | Blob)[], mergedFileName: string): Promise<File>
files
: An array of files (File
or Blob
objects) to be merged.mergedFileName
: The name of the merged file.Promise
that resolves with the merged file.