File upload progress bar for Django?

1,289 views
Skip to first unread message

M Godshall

unread,
Oct 20, 2008, 12:22:21 PM10/20/08
to Django users
I've found several file upload progress bar applications, but the
source code is usually written in php (like http://www.swfupload.org/
and http://www.pixeline.be/experiments/jqUploader/). Is anyone
familiar with a django or python tutorial that shows how to implement
some kind of file upload progress bar? Ideally I'd like to use
jquery, but I'm open to anything at this point. Any links or code
examples would be greatly appreciated. Thanks!

Sascha Brossmann

unread,
Oct 20, 2008, 7:15:42 PM10/20/08
to Django users
> Is anyone
> familiar with a django or python tutorial that shows how to implement
> some kind of file upload progress bar?

Sorry, but the main magic in those uploaders is done via flash, not
via js or php. AFAIK there is currently no sane (though you may use
Java ;-)) way to do it otherwise.

varikin

unread,
Oct 21, 2008, 10:07:43 AM10/21/08
to Django users


On Oct 20, 6:15 pm, Sascha Brossmann <sascha.brossm...@googlemail.com>
wrote:
I also think some JavaScript libraries offer them to, like jQuery, but
I have tried any of that.

jonknee

unread,
Oct 21, 2008, 2:06:34 PM10/21/08
to Django users
On Oct 20, 7:15 pm, Sascha Brossmann <sascha.brossm...@googlemail.com>
wrote:
You can do it with some JavaScript and a server-side script written in
most languages besides PHP (though I think there is now a way with an
extension in 5.2). Perl is commonly used in the pre-made solutions as
it's typically available and involves little setup.

Flash is most likely easier as there are lots of pre-made solutions,
but can have some session and compatibility issues (the recent Flash
10 update messed up a *lot* of upload forms around the web).

You could make a Django upload handler to do the progress updates, the
docs even talk about this:

http://docs.djangoproject.com/en/dev/topics/http/file-uploads/

john Moylan

unread,
Oct 21, 2008, 3:57:59 PM10/21/08
to django...@googlegroups.com
There are working examples around. Basically get your server to report the upload status to a javascript ui at intervals. Try searching the djangoproject trac server - there is a link from there to a django uploader project on google code that I have used in the past. I think it uses JQuery.

I'd search the the link myself to put it into this email but it's been a very long day....need sleep.

J

2008/10/21 jonknee <m...@jongales.com>

jo...@fairviewcomputing.com

unread,
Oct 21, 2008, 6:08:01 PM10/21/08
to django...@googlegroups.com
On Oct 20, 2008, at 12:22 PM, M Godshall wrote:

> Is anyone familiar with a django or python tutorial that shows how
> to implement
> some kind of file upload progress bar? Ideally I'd like to use
> jquery, but I'm open to anything at this point. Any links or code
> examples would be greatly appreciated.

I couldn't find any tutorials, but it's come up on this list before:

http://groups.google.com/group/django-users/search?group=django-users&q=progress+bar

And there are a couple of good examples on djangosnippets.org:

http://djangosnippets.org/snippets/678
http://djangosnippets.org/snippets/679

Unfortunately they're not accessible at the moment.

Since it keeps coming up, I put together a demo app showing how the
pieces fit together. It also shows how you could use nginx and its
mod_uploadprogress instead, to avoid tying up your Django processes
with slow uploads.

http://www.fairviewcomputing.com/blog/2008/10/21/ajax-upload-progress-bars-jquery-django-nginx/

jo...@fairviewcomputing.com

unread,
Oct 22, 2008, 7:54:31 AM10/22/08
to django...@googlegroups.com
On Oct 20, 2008, at 12:22 PM, M Godshall wrote:

> Is anyone familiar with a django or python tutorial that shows how
> to implement
> some kind of file upload progress bar? Ideally I'd like to use
> jquery, but I'm open to anything at this point. Any links or code
> examples would be greatly appreciated.

I couldn't find any tutorials, but it's come up on this list before:

Ian Lawrence

unread,
Oct 22, 2008, 8:31:59 AM10/22/08
to django...@googlegroups.com
Hi
very cool..thx for putting this together. You have saved me some time!

Ian


--
http://ianlawrence.info

Reply all
Reply to author
Forward
0 new messages