#2070: Large streaming uploads
----------------------------------------+-----------------------------------
Reporter: [EMAIL PROTECTED] | Owner: jacob
Status: assigned | Component: Core framework
Version: SVN | Resolution:
Keywords: streaming, upload, large | Stage: Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 1
----------------------------------------+-----------------------------------
Comment (by Michael Axiak <[EMAIL PROTECTED]>):
I've cleaned the !FileProgressDescriptor architecture a little bit. Three
changes for this patch:
- using {{{request.__class__ = descriptor}}} rather than using a weird
descriptor wrapper.
- defaulting to a {{{NullFileProgressDescriptor}}} (which does nothing)
versus one that stored the information in temp upload directory.
- making {{{safe_file_move}}} do nothing if the source and destination
are the same string.
If you want to track file upload progress you need to install the stuff
from #4165. This ticket just contains the hooks to get #4165 there with
just a minimal of contrib. This patch makes that even clearer by removing
the last remnants of functional file progress tracking.
I *think* this is probably where we want to leave this ticket (in terms of
what should be cut out of it, what should be put in). Although, I can see
several other separation (take care of form stuff in another ticket, for
instance).
It is worth noting (because someone had issue with this in IRC), that if
you try to use this {{{save_FIELD_file(name, content)}}} should now be
given a {{{request.FILE}}} item, rather than the actual content of the
file.
For example:
{{{
#!python
object.save_video_file(request.FILE['video']['filename'],
request.FILE['video']['content'])
}}}
is '''bad''', since the mere invocation
{{{request.FILE['video']['content']}}} will load all the content into
memory, exactly what we're trying to avoid.
The new version looks like:
{{{
#!python
object.save_video_file(request.FILE['video']['filename'],
request.FILE['video'])
}}}
In reply to [comment:133 SmileyChris], we have to have an upload directory
anyway, since the FileProgressDescriptor only changes how file *progress*
is tracked, not the actual uploading of files (that is, it has to go into
a directory, or else this entire thing is disabled). We could rename and
clean up if people prefer it changed.
--
Ticket URL: <http://code.djangoproject.com/ticket/2070#comment:143>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---