On 9/23/06, James Gardner <[EMAIL PROTECTED]
> wrote:
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?
That would take care of part of it, but the other part is once the server has the file and has to distribute it to other servers, via FTP for example. So the call chain looks like this:
client -----> this app's server ------> FTP server 1, FTP server 2, etc.
I assume threading of some kind would need to be involved because of the time it might take. For example, simply passing a one-line text file to one of my servers with a fast connection takes ~10 seconds, I think mostly FTP overhead (it takes about 1.5 seconds via SFTP). Suppose I have ten servers to upload to. That's 100 seconds, which is 40 seconds more than when HTTP requests time out IIRC. Furthermore, I'd like to spread the file out across the other servers in parallel, because it's probably IO-bound and there seem to be a lot of delays involved with FTP and SFTP in setup and teardown.
I really should just try making some threads and seeing if it works. It's the former Zope/PHP programmer in me that keeps expecting everything to go haywire if I just do something the way that would be natural to a Python programmer. :)
--
Daniel
http://www.storytotell.org -- Tell It!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
