Amazon S3 file upload - 405 (Method Not Allowed) #771

Open
opened 2017-04-30 22:25:57 +00:00 by tarundhillon · 1 comment
tarundhillon commented 2017-04-30 22:25:57 +00:00 (Migrated from github.com)

Hi,

I am trying to upload the file directly to an Amazon S3 bucket.

`
this.uploader.options.disableMultipart = true;

this.uploader.authToken = obj['Credentials']['SessionToken']; // obj is generated from AWS.STS
--> SessionToken
`

S3 Bucket CORS

<CORSRule> <AllowedOrigin>http://localhost:4200</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedMethod>POST</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <AllowedHeader>*</AllowedHeader> </CORSRule>

I am getting an error

zone.js:2019 POST http://----------------2.amazonaws.com/data/ 405 (Method Not Allowed)

Any suggestions on how to address the error? Is STS the right way to provide the authToken parameter.

Thanks

Hi, I am trying to upload the file directly to an Amazon S3 bucket. > ` > this.uploader.options.disableMultipart = true; > this.uploader.authToken = obj['Credentials']['SessionToken']; // obj is generated from AWS.STS --> SessionToken > ` S3 Bucket CORS > > `<CORSRule> > <AllowedOrigin>http://localhost:4200</AllowedOrigin> > <AllowedMethod>GET</AllowedMethod> > <AllowedMethod>PUT</AllowedMethod> > <AllowedMethod>POST</AllowedMethod> > <MaxAgeSeconds>3000</MaxAgeSeconds> > <AllowedHeader>*</AllowedHeader> > </CORSRule>` I am getting an error > zone.js:2019 POST http://----------------2.amazonaws.com/data/ 405 **(Method Not Allowed)** Any suggestions on how to address the error? Is STS the right way to provide the authToken parameter. Thanks
hiddencaliber commented 2017-06-23 05:25:47 +00:00 (Migrated from github.com)

@tarundhillon - You have to use PUT for uploading the files directly to S3 bucket

@tarundhillon - You have to use `PUT` for uploading the files directly to S3 bucket
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#771