File upload, with progress messages as file is parsed

19 views
Skip to first unread message

rick...@gmail.com

unread,
Sep 3, 2011, 6:41:37 PM9/3/11
to we...@googlegroups.com
  I have users upload files, which are then parsed into a database.  The parsing takes a non-trivial amount of time (few minutes) so I want the user to see progress messages.  I have been poking at this problem for several days.  I could use some advice on the general approach, or verification that I am on the right track.

  It looks like AJAX is the tool.  It would be OK for the client to poll the server for the parsing progress, though comet web-push would be ideal.  Simple text responses would be fine, rather than a progress bar; something like "1234 of 2345 lines processed, 4 new, 1230 duplicates ignored".

  I have found some examples of using jQuery with web.py, so I have an idea of the how to format the AJAX calls.  However, I can't quite see how to line it all up.

  The client needs a loop to periodically poll the server, but where should that loop be?  As Javascript in the template file?  In one of the Python methods?  Somewhere else?

  Meanwhile, the server would be doing the parsing.  Where would that be happening?  In the web.py application?  As a separate subapplication or thread or queue or multiprocess?  If so, how can I get the AJAX call to it?

  Somebody must have done something similar, but I haven't stumbled on the right search terms.
Reply all
Reply to author
Forward
0 new messages