Coretex
|
Public Member Functions | |
str | run (self) |
A class which splits a file into chunks and uploades it chunk by chunk. This class should be used for uploading files larger than 2 GiB, since Python does not support uploading files with a larger size. Maximum chunk size is 128 MiB. Properties ---------- chunkSize : int size of chunks into which the file will be split maximum value is 128 MiB, while the minimum value is 1 filePath : Union[Path, str] path to the file which will be uploaded fileSize : int size of the file which will be uploaded mimeType : str mime type of the file - if None is passed, guess will be performed, if guess fails Exception will be raised
Definition at line 38 of file chunk_upload_session.py.
str coretex.networking.chunk_upload_session.ChunkUploadSession.run | ( | self | ) |
Uploads the file to Coretex.ai Returns ------- str -> ID of the uploaded file Raises ------ NetworkRequestError, ValueError -> if some kind of error happened during the upload of the provided file Example ------- >>> from coretex.networking import ChunkUploadSession, NetworkRequestError \b >>> chunkSize = 16 * 1024 * 1024 # chunk size: 16 MiB >>> uploadSession = ChunkUploadSession(chunkSize, path/fo/file.ext) \b >>> try: uploadId = uploadSession.run() print(uploadId) except NetworkRequestError, ValueError: print("Failed to upload file")
Definition at line 111 of file chunk_upload_session.py.