Python CGI Upload from Server Status

Derek Tracy tracyde at gmail.com
Fri Jun 6 09:24:23 EDT 2008


On Fri, Jun 6, 2008 at 9:16 AM, John Dohn <john.dohn.john at gmail.com> wrote:

> On Sat, Jun 7, 2008 at 12:50 AM, Derek Tracy <tracyde at gmail.com> wrote:
>
>> I am trying to create a simple python cgi app that allows the user to kick
>> off an ftp from the server the cgi is on to another server; I have that
>> piece working using ftplib but since the files in question are usually very
>> large (500mb to 2gb) in size I want to be able to display some sort of
>> status to the user, preferrably a progress bar of some sort.
>
>
> You'll need some AJAX progress bar (hint: google for this term ;-) that
> will be getting updates from the server or request an update every second or
> so.
>
> The question is if your upload code can provide progress tracking? If it's
> just a call to some xyz.upload("/here/is/my-500M-file.bin") that only
> returns after several minutes of uploading without giving you any updates on
> how fast things go you're probably out of luck.
> OTOH if it can do e.g.callbacks for progress reporting or if it can run in
> a separate thread that you could query somehow you can hook that to that
> AJAX thing of your choice.
>
> JDJ
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

I will look for the AJAX Progress Bar, but I will admit I have never touched
AJAX and haven't written javascript in years.

I patched Pythons ftplib.py storbinary() to send callbacks to the specified
method, so I have the callbacks locked down.  The thing to note is that this
app isn't allowing the user to upload to the server the cgi is on but rather
allowing the user to kick off an ftp process on the server to another
server.

Would there be a way to do this with python cgi and automatically append or
update information on the page it is displaying?

-- 
---------------------------------
Derek Tracy
tracyde at gmail.com
---------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080606/07a46111/attachment-0001.html>


More information about the Python-list mailing list