Jay Loden | 29 Jan 2007 09:38
Picon
Favicon

Re: upload handling

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

__._,_.___
Recent Activity
Visit Your Group
SPONSORED LINKS
Give Back

Yahoo! for Good

Get inspired

by a good cause.

Y! Toolbar

Get it Free!

easy 1-click access

to your groups.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___
Attachment (upload.zip): application/zip, 5167 bytes

Gmane