diff --git a/apps/api/plane/settings/storage.py b/apps/api/plane/settings/storage.py index 4ebf6c58e80..7ecb201e2cc 100644 --- a/apps/api/plane/settings/storage.py +++ b/apps/api/plane/settings/storage.py @@ -62,21 +62,16 @@ def generate_presigned_post(self, object_name, file_type, file_size, expiration= """Generate a presigned URL to upload an S3 object""" if expiration is None: expiration = self.signed_url_expiration - fields = {"Content-Type": file_type} + fields = { + "Content-Type": file_type, + "bucket": self.aws_storage_bucket_name, + } conditions = [ - {"bucket": self.aws_storage_bucket_name}, ["content-length-range", 1, file_size], {"Content-Type": file_type}, ] - # Add condition for the object name (key) - if object_name.startswith("${filename}"): - conditions.append(["starts-with", "$key", object_name[: -len("${filename}")]]) - else: - fields["key"] = object_name - conditions.append({"key": object_name}) - # Generate the presigned POST URL try: # Generate a presigned URL for the S3 object