Hi Daniel, > I've got an app I'm working on and one feature is that you can upload a > file and it passes the file to other servers via FTP or SFTP. I'd like > to implement a list that shows you the upload progress. > > The best way to do it, I think, would be to have a thread be created to > do the uploading for each server. Have the upload routine call some > notification function for progress, and have that information be passed > back out to the page via some kind of JSON over XmlHttpRequest or > something.
The simple way I thought of doing this was when the user clicks "Submit" to start the upload an AJAX call asks the server for a unique ID before the form is actually submitted (which could be based on the IP of the user if you were worried about security). The upload then starts and as data was received the file would be written somewhere on the server. The page would then regularly make new requests to the server with the ID it was assigned, the server reads the file size that has been written so far for the ID it was sent and returns it whilst the upload itself is happening in a different request. No complex threading would be required. Wouldn't that work? Cheers, James --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss -~----------~----~----~----~------~----~------~--~---
