How To Use Python/cgi For File Uploading
Solution 1:
This is more complex than it seems, given how file uploading works in the HTTP protocol. Most web servers will give control to the CGI script only when the uploaded file has been completely transferred, so there's no way to give feedback in the meanwhile.
There are some Python libraries that attempt to tackle this issue, though. For example: gp.fileupload (works with WSGI, not CGI).
The trick is to provide a way to query the upload progress via AJAX while still transferring the uploaded file. This is of no use if the web server (for example, Apache or nginx) is not configured to support the upload progress feature because you will probably see a 0% to 100% jump in the progress bar.
I suggest you try Plupload, which works on the client-side and is much simpler.
Post a Comment for "How To Use Python/cgi For File Uploading"