IPWorks Cloud 2020 Python Edition

Questions / Feedback?

create_object Method

Creates a new object in the currently selected bucket.

Syntax

def create_object(object_name: str) -> None: ...

Remarks

This method creates a new object named Object in the bucket currently selected by bucket. If there are any metadata items present in the Metadata* properties, they will included in the creation request.

If local_file is set the file will be uploaded from the specified path. If local_file is not set the data in object_data will be used.

To encrypt the file before uploading it, set encryption_algorithm and encryption_password. This method can automatically handle the multipart upload of objects (See Below). If it is desired to manually take control of the multipart upload process see start_multipart_upload.

Automatic Multipart Uploads

If more than SimpleUploadLimit bytes of data are provided, the class will automatically perform a multipart upload by splitting the data up into parts (sized according to the FragmentSize configuration setting) and uploading them individually. To accomplish this, the class automatically makes calls to start_multipart_upload, upload_part, and complete_multipart_upload internally; tracks upload state information using the ResumableUploadState configuration setting; and tracks how much data has been uploaded using the start_byte property. The on_fragment_complete event will fire after each part is uploaded.

If, during an automatic multipart upload, any individual request fails, the upload can be resumed be calling this method again with the same parameters, so long as ResumableUploadState and start_byte contain the same values as they did when the upload was interrupted.

When an automatic multipart upload completes successfully, ResumableUploadState is cleared and start_byte is reset to 0.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Python Edition - Version 20.0 [Build 8265]