3

I am attempting to upload a file into a different users bucket with only write access. I have attempted to use both methods. put_object seems to work while upload_file does not.

Zillah
  • 31
  • 2
  • Can you show what error `upload_file` gives you? Do you know what policy your user has for the bucket? Those two methods should use the same permissions I believe. – John C Mar 08 '18 at 23:54
  • @JohnC unfortunately I do not know details other than we have getObject and putObject permissions. The error I am getting for upload_file is PermissionDenied. – Zillah Mar 12 '18 at 17:20

1 Answers1

1

As per this What is the Difference between file_upload() and put_object() when uploading files to S3 using boto3 put_object will send it all in one put with a 5GB limit.

upload_file will do "multipart" uploads if necessary and calls a callback function when done.

I think you need all of these permissions to use upload_file:

"Effect": "Allow",
      "Action": [
        "s3:AbortMultipartUpload",
        "s3:DeleteObject",
        "s3:ListMultipartUploadParts",
        "s3:PutObject",
        "s3:GetObject"
Bktrout47
  • 31
  • 3