I'm trying to use flowjs
/ng-flow
to upload images but I'm not getting anything on my backend.
This is the method that is supposed to receive the images in my Flask routes.py
:
@app.route('/api/file/upload/', methods = ['GET', 'POST'])
@login_required
def upload_files():
if request.method == 'GET':
print "GET"
print request.args
else:
print "POST"
print request.args
return "200"
Before finding out that I had to set testChunks:false
, I was receiving only a GET
request and request.args
looked like this:
ImmutableMultiDict([('flowFilename', u'coldplay_butterfly.JPG'), ('flowTotalChunks', u'1'), ('flowRelativePath', u'coldplay_butterfly.JPG'), ('flowTotalSize', u'35338'), ('flowCurrentChunkSize', u'35338'), ('flowIdentifier', u'35338-coldplay_butterflyJPG'), ('flowChunkSize', u'1048576'), ('flowChunkNumber', u'1')])
As for the POST
, I get this:
ImmutableMultiDict([])
I have no idea why this is happening. I could also use some help on what to do after I get the array with the files, as in how to properly save the images to a folder inside my project. The only example I found was in PHP, so if someone could clarify how to do that in Python I would really appreciate it!
Thanks!