CodexBloom - Programming Q&A Platform

OCI Object Storage: how to to Set Up Pre-Signed URLs for Large Files Using SDK v2.22.0

πŸ‘€ Views: 79 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-12
oci object-storage presigned-url Python

I'm updating my dependencies and I've searched everywhere and can't find a clear answer. I'm trying to implement I'm collaborating on a project where I'm relatively new to this, so bear with me. I've been struggling with this for a few days now and could really use some help. I'm trying to generate pre-signed URLs for uploading large files to OCI Object Storage using the OCI SDK for Python (v2.22.0). While the documentation provides a general overview, I'm working with issues specifically with files over 5 GB. I attempted to use the `generate_presigned_url` method, but I'm getting a `400 Bad Request` response when trying to upload files of this size. Here’s the code snippet I'm using: ```python import oci config = oci.config.from_file() object_storage_client = oci.object_storage.ObjectStorageClient(config) bucket_name = 'my_bucket' object_name = 'large_file.dat' try: pre_signed_url = object_storage_client.generate_presigned_url( 'PUT', bucket_name=bucket_name, object_name=object_name, expires_in=3600 ) print(f'Pre-signed URL: {pre_signed_url}') except oci.exceptions.ServiceError as e: print(f'ServiceError: {e}') ``` When I attempt to upload using this URL with a file size greater than 5 GB, I receive the behavior: `The request is invalid. Check your request and try again. (HTTP Status Code: 400)`. I have successfully generated pre-signed URLs for smaller files (less than 5 GB), so I'm not sure if this is a limitation of the service or if I'm missing something in the configuration. I've also checked my bucket policies and permissions, which seem to allow the necessary actions. Has anyone else encountered similar issues or have insights on limitations regarding pre-signed URLs for large file uploads in OCI? Any ideas what could be causing this? My development environment is Windows. This is part of a larger application I'm building. My development environment is Ubuntu 22.04. I'm working in a Windows 10 environment. This is for a microservice running on macOS. This is part of a larger microservice I'm building.