0

I'm trying to upload some files inside a S3 bucket with a POST request (using plupload).

I'm getting a 405 (Method Not Allowed)

The policy is as follow:

<?xml version="1.0" encoding="UTF-8"?>
  <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
      <AllowedOrigin>*</AllowedOrigin>
      <AllowedMethod>GET</AllowedMethod>
      <AllowedMethod>POST</AllowedMethod>
      <MaxAgeSeconds>3000</MaxAgeSeconds>
      <AllowedHeader>*</AllowedHeader>
    </CORSRule>
  </CORSConfiguration>

But the response headers are baffling:

Access-Control-Allow-Methods:GET, POST
Access-Control-Allow-Origin:*
Access-Control-Max-Age:3000
Allow:GET, DELETE, HEAD, PUT

The Access-Control-Allow-Methods looks fine, but the Allow does not.

I don't get why the Allow header doesn't contain POST and how to change it.

Any help would be really appreciated

framp
  • 813
  • 11
  • 22
  • On what path do you get this response? The root of your bucket? Some sub-directory? I don't think you can expect `POST` to be allowed on any file resource. Also, I don't think CORS configuration would ever affect the allow header. It's meant to control the `Access-Control-*` headers. – Myrne Stol Feb 27 '14 at 14:18
  • I'm getting it on a subdirectory. Yeah, I just can't find a way on S3 to modify the Allow header. – framp Feb 27 '14 at 14:36
  • Am I missing something obvious? I'm just trying to upload some files inside a bucket directory. Maybe I'm misinterpreting the cause for the 405 Method Not Allowed – framp Feb 27 '14 at 14:39
  • Are you posting against the website endpoint or a hostname that's provisioned as a `CNAME` or Route 53 Alias for the web site endpoint? Because I suspect those don't accept `POST` ... if that's true, you need to use the REST endpoint, bucketname.s3.amazonaws.com. – Michael - sqlbot Feb 27 '14 at 20:19
  • Thank you but I'm already using bucketname.s3.amazonaws.com – framp Feb 27 '14 at 22:03

1 Answers1

0

Not sure what was the problem, probably a misconfiguration somewhere.

Fixed it by deleting everything, creating a new bucket and following the official plupload documentation.

framp
  • 813
  • 11
  • 22