Amazon S3 - 405 Method Not allowed using POST (Although I allowed POST on the bucket)

后端 未结 1 807
花落未央
花落未央 2020-12-19 15:57

I am facing a problem that my graph (Using AJAX - POST - PHP) is not appearing on Amazon

http://cdpmotest.s3-website.eu-central-1.amazonaws.com/

its says (W

相关标签:
1条回答
  • 2020-12-19 16:03

    The direct cause of the error is unrelated to CORS, and is actually caused by the fact that that the S3 website endpoints don't support POST (only the REST endpoints support it, but that's not actually related to the problem at hand).

    The real problem is that you appear to be trying to use S3 for something it doesn't do.

     $.ajax({
         url: 'graph-data.php',
         type: 'POST',
    

    S3 is an object store, not an application server.

    You can't run php on S3. You can't execute any server-side code on S3.

    You can host a static website on Amazon S3. On a static website, individual web pages include static content. They may also contain client-side scripts. By contrast, a dynamic website relies on server-side processing, including server-side scripts such as PHP, JSP, or ASP.NET. Amazon S3 does not support server-side scripting.

    http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html

    That same page of the documentation will point you to alternative AWS solutions for accomplishing what you want.

    0 讨论(0)
提交回复
热议问题