willwebberley / flaskdirectuploader Goto Github PK
View Code? Open in Web Editor NEWA simple application demonstrating direct uploads to S3 using Python
A simple application demonstrating direct uploads to S3 using Python
Hi,
Thanks for making this companion repo. It made my life easier!
I'd like to add some kind of progress indication of the upload since I'm uploading large ZIP files. Is it possible to achieve this using the format laid out in this repo?
Thanks,
Alberto
I deployed this to Heroku and get the "Could not get signed URL." pop-up window after trying to upload a picture.
The console has:
Mixed Content: The page at 'https://xxxx.herokuapp.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://xxxx.herokuapp.com/sign-s3/?file-name=myimage.jpg&file-type=image/jpeg'. This request has been blocked; the content must be served over HTTPS.
Hi,
I have followed your example using Django as framework and Python version 2.7.4.
The bucket is created in the region "eu-west-1" (Ireland), with the setup that you recommend.
But when I try to read the url generated I receive the following error:
SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.
The credentials I am using have Administrator Access.
Could you please help me?
Thanks.
I'm struggle to upload the file. Should I change anything if I'm using a bucket in the EU (Ireland) region?
I'm getting the following error message:
This is my cors file:
<?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>
<AllowedMethod>PUT</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
What am I doing wrong?
Is anyone else using this code and having intermittent 403s from S3? I cannot seem to diagnose the issue, requests to flask seem to be OK, and Amazon seems to be 403ing randomly.
Response ex:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><StringToSignBytes>50 55 54 0a 0a 69 6d 61 67 65 2f 6a 70 65 67 0a 31 33 37 34 30 34 33 35 36 38 0a 78 2d 61 6d 7a 2d 61 63 6c 3a 70 75 62 6c 69 63 2d 72 65 61 64 0a 2f 63 61 70 74 69 6f 6e 61 62 6c 65 2f 75 73 65 72 2f 72 42 37 62 34 36 33 71 63 33 77 36 6e 6d 6a 43 53 63 72 59 76 4c</StringToSignBytes><RequestId>C455814458B0A829</RequestId><HostId>YHSZBBCpOq9TbvfBcnjLSXqpm8Y0ZjN98xT7UFv8K75ulyZjx/O+JPcVl/IDpvy+</HostId><SignatureProvided>o 5HV5tP6gGqbDxIDzSJs5LG3h0=</SignatureProvided><StringToSign>PUT
image/jpeg
1374043568
x-amz-acl:public-read
/wcdolphin/user/rB7b463qc3w6nmjCScrYvL</StringToSign><AWSAccessKeyId>AKIAIVZG6FLQHLGRUN7Q</AWSAccessKeyId></Error>
I downloaded the whole source file as it is and just pushed the same to heroku without any changes, getting Bad request error.
I have verified S3 Cors configuration as well, it is correct.
Found this app from the Heroku s3/python article, so I tried this code in my own app and was having some problems. So I tried cloning this locally and running it and no dice with it, either. This is the error I'm getting in the js console. Thanks!
XMLHttpRequest cannot load https://none.s3.amazonaws.com/default_name?AWSAccessKeyId=AKIAIXJKZPM6QPUKGSTA&Expires=1415740199&Signature=gRuJtBb5CbvyC7bt5mNTcl8y5uk%3D. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:5000' is therefore not allowed access. The response had HTTP status code 403.
This is the CORS file I'm using on the bucket, if that's helpful -
<?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>
<AllowedMethod>PUT</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.