I'm switching from dropzone.js to filedrop.js. I'm using the same endpoint as I did for dropzone.js, but I get a 400 error dropping the example code into my html. I'm not quite sure where to go from here to debug it. I'm not sure if it's a simple different in how filedrop.js handles encoding or domains compared to dropzone.js. Any tips for debugging this?
Here's the request being set out when uploading a png.
Accept:
*/*
Accept-Encoding:
gzip, deflate
Accept-Language:
en-US,en;q=0.8
Connection:
keep-alive
Content-Length:
1132236
Content-Type:
application/octet-stream
Cookie:
session=eyJ1c2VybmFtZSI6InN0cmF0dG9uYnJhemlsQGdtYWlsLmNvbSJ9.CLpJRw.NsmzkIGOzH-nFFvKTiBWtIwvlFw
Host:
localhost:5000
Origin:
Referer:
User-Agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36
X-File-Date:
Tue, 09 Sep 2014 14:29:26 GMT
X-File-Name:
Screenshot%20from%202014-09-09%2007%3A29%3A26%20-%201.png
X-File-Size:
1132236
X-File-Type:
image/png
X-Requested-With:
FileDrop-XHR-FileAPI
- Request Payload
- ‰PNG
- And here's the code I had previously in the handler.
@app.route('/header', methods=['GET', 'POST'])
@requires_auth
def header(forcedName=None):
print('header')
if request.method == 'POST':
file = request.files['file']
print(file)