Skip to content

Instantly share code, notes, and snippets.

@dacur
dacur / CORS_configuration
Last active July 12, 2024 00:18
Using AngularJS with Amazon AWS:S3 image uploads. Create new Amazon bucket. Under permissions, grant 'Everyone': List and Upload/Delete privileges. Be sure to set up Amazon bucket permissions below, as well. The image URL, when returned from Amazon, is being saved in $scope.imageURL. Now you can pass the image URL to your API from another functi…
Add under Permissions in your Amazon bucket:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>