Re: upload handling
2007-01-29 08:38:26 GMT
In case this helps anyone else, I figured I'd post some sample code I used to get a progress bar working with Clearsilver (Python back end)
Caveats:
* This includes minimal (if any) error checking
* has only been tested in IE6 and Firefox
* assumes you are uploading to /tmp/uploads and that you have a /tmp/uploads/progress file to track the progress
* due to above assumptions, only works with one upload at a time ;)
The code includes an html form to submit the upload filename, a Python upload script, and a Python script for fetching the progress data. The client-side work is some really simple javascript that will print out a progress bar with a percent complete as the file uploads. There is no page reloading, since the javascript uses XMLHttpRequest to get the progress data.
It's rough around the edges and I don't recommend using it for anything other than a proof of concept or example code, but it illustrates all the major parts of a decent upload with progress indicator. I'm attaching it as a .zip instead of a tar.gz to be nice to any Windows users out there.
-Jay
----- Original Message ----
From: Brandon Long <blong <at> fiction.net>
To: zeegco <zeegco <at> yahoo.com>
Cc: ClearSilver <at> yahoogroups.com
Sent: Monday, January 8, 2007 12:27:37 AM
Subject: Re: upload handling
There have been a couple messages on the group about using clearsilver
for file uploads, see:
http://tech.groups.yahoo.com/group/ClearSilver/message/429
Brandon
__________________________________________________________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
RSS Feed