#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]>):
Replying to [comment:128 anonymous]:
> Hi,
>
> I have tested under window xp, apache 2.2.4, mod_python 3.3. When
I upload a large file via admin interface.
> A temp file with named by session generated by javascript client is
created. However, a file with random name and '.upload' extension is also
created. File stream is append to '.upload' version instead of session id
one.
>
> Any idea??
Yes, this is how it is supposed to work, which is why there are hooks for
middleware (see illustration middleware in #4165).
You see, we don't need to keep track of the actual file that's being
uploaded, because it's always being uploaded (by the same thread, same
loop, etc.). We do need to be able to look for the 'progress' of that file
upload, which has to be stored in some persistent manner, keyed by the
session id. Since the file upload code has no model, can't rely on cache,
and does have a safe place to put temp files, it by default puts that
state information in that location.
If you install the patch {{{5126_file_upload_contrib_app.diff}}} and add
{{{'django.contrib.uploadprogress.middleware.FileProgressCached'}}} to
your {{{MIDDLEWARE_CLASSES}}} setting, the cache framework will be used,
and no session_id file will be created.
Alternatively, you can use that patch and add
{{{'django.contrib.uploadprogress.middleware.FileProgressDB'}}} to your
{{{MIDDLEWARE_CLASSES}}} and add {{{'django.contrib.uploadprogress'}}} to
your {{{INSTALLED_APPS}}} (and run a {{{syncdb}}}...).
Or, you are welcome to look at the code in
{{{django.contrib.uploadprogress.middleware.FileProgressCached}}} and
write your own method of storing this file progress information (it's in a
dictionary format).
Sounds like it's working though, thanks for the feedback.
--
Ticket URL: <http://code.djangoproject.com/ticket/2070#comment:129>
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
-~----------~----~----~----~------~----~------~--~---