简体   繁体   中英

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 (ie 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!

I don't think it is related to Flask

Please see this link:

I think these are be helpful

request.META['REMOTE_ADDR'], request.GET['X-Progress-ID']

我尚未对其进行测试,但在此处找到了类似内容的链接

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM