are we in public mode ?
OptionaldestinationFolder: Folderthe context folder to operate, relative to the root folder
Get registered custom headers for uploads
Get the upload destination path relative to the root folder
Set the upload destination path relative to the root folder
Get the estimation for the uploading time.
Get the upload queue stats
Get the upload queue
Get the root folder
Uploads multiple files or folders while preserving the relative path (if available)
The destination path relative to the root folder. e.g. /foo/bar (a file "a.txt" will be uploaded then to "/foo/bar/a.txt")
The files and/or folders to upload
Optionalcallback: (Callback that receives the nodes in the current folder and the current path to allow resolving conflicts, all nodes that are returned will be uploaded (if a folder does not exist it will be created)
Cancelable promise that resolves to an array of uploads
// For example this is from handling the onchange event of an input[type=file]
async handleFiles(files: File[]) {
this.uploads = await this.uploader.batchUpload('uploads', files, this.handleConflicts)
}
async handleConflicts(nodes: File[], currentPath: string) {
const conflicts = getConflicts(nodes, this.fetchContent(currentPath))
if (conflicts.length === 0) {
// No conflicts so upload all
return nodes
} else {
// Open the conflict picker to resolve conflicts
try {
const { selected, renamed } = await openConflictPicker(currentPath, conflicts, this.fetchContent(currentPath), { recursive: true })
return [...selected, ...renamed]
} catch (e) {
return false
}
}
}
Unset a custom header
The header to unset
Pause any ongoing upload(s)
Set a custom header
The header to set
The string value
Resume any pending upload(s)
Upload a file to the given path
the destination path relative to the root folder. e.g. /foo/bar.txt
the file to upload
Optionalroot: stringthe root folder to upload to
number of retries
Initialize uploader