A little late, but as promised, I've bundled the code I'm using for
handling large file uploads in my application.  It's a bit of a cheat
-- it actually uses a CGI for handling the actual upload and requires
an embedded iframe to make things work quite right.  But it has the
following features:

* Low memory footprint uploads for large files -- uploaded content is
written to the disk in blocks
* Progress reporting, including percent completed, via a JSON interface
* A few template tags for auto-magically creating the iframe and its contents.

And it has the following caveats:

* It requires a "real" webserver, and won't work with only the Django dev server
* It's not a ready-made solution: it requires integration work.  If
you don't like writing custom manipulators, this code isn't for you.

The package, available at
http://projects.yergler.net/basket/upload-support.zip, is the Django
application which provides the JSON views and template tags.  There's
a somewhat-incomplete README in the package, and an examples
directory.  The examples directory contains two files of interest:
forms.py and upload.html.  forms.py is an example of how I use the
upload support in my application to complete the submission.
upload.html is an example of a template which uses the upload support.

Note that the UI is currently based on the Yahoo UI Library.

Feel free to email questions, and I'll answer as well as I can.  I
don't see this as a particularly long-lived project, because I expect
that the Django developers will support large file uploads eventually,
at which point the need for this will go away.

Nathan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to