Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get status of uploading file in Flask

There is a need to add some kind of an upload progress dialog to my application. I know there are plenty of Flash/Java/HTML5 solutions for that, however they are not suitable in my case.

Flask documentation gives "an easier solution" offering Flask-Uploads extension. However I haven't found any kind of solution for my question there.

Is there any possibility to get the status of uploading file (i.e. number of bytes already uploaded)?

In fact, I know that Flask accumulates the file data in memory if file size is not big. Otherwise, it stores the file in the temporary folder. If there are no options of getting the number of received bytes, maybe there are ways of getting the temp filename at least?

Any kind of tricks are very welcome.

Thanks for help!

like image 662
VisioN Avatar asked May 09 '12 19:05

VisioN


1 Answers

I don't think it is related to Flask

Please see this link:

  • Upload to Django with progress bar using Ajax and jQuery Laurent Luce's Blog

I think these are be helpful

request.META['REMOTE_ADDR'], request.GET['X-Progress-ID']
like image 193
Mohammad Efazati Avatar answered Oct 11 '22 11:10

Mohammad Efazati