Upload module for elements.
Classes:
|
A process to upload multiple files. |
Functions:
|
Resolve files and folders into individual upload files. |
|
Convenience function to upload multiple files. |
- class elements_http_upload.upload.UploadProcess(settings: UploadSettings, *uploads: FileUpload)
Bases:
objectA process to upload multiple files.
Methods:
A worker to finish uploads
Register the upload for the individual file uploads
Worker to split files input smaller chunks for upload.
start()Start the upload process.
A worker function to upload chunks
- start()
Start the upload process.
- elements_http_upload.upload.resolve_uploads(*uploads: FileUpload, recursive: bool = False, target_root: Path | None = None) List[FileUpload]
Resolve files and folders into individual upload files.
- Parameters:
*uploads (FileUpload) – The file or directory information for the upload. If a
sourcepoints to a directory, recursive has to be true.recursive (bool, optional) – Whether folders should be check recursively, by default False. If an uploads
sourcepoints to a directory and this option isFalse, an error is raised.target_root (Optional[Path], optional) – Root folder on the remote system, by default None. If this is set, all
targetpaths in the uploads need to be relative and will be appended to the target_root. If this is not, alltargetpaths in the uploads need to be absolute paths.
- Returns:
_description_
- Return type:
List[FileUpload]
- elements_http_upload.upload.upload(*files: FileUpload | FileUploadDict | str, **setting_kws)
Convenience function to upload multiple files.
This function is a conventience method to upload multiple files. It starts an upload process with the given settings and uploads them in parallel.
- Parameters:
*files (FileUpload) – The files to upload
**settings – Key-value pairs for the for the
UploadSettings