Hi everyone,

I'm trying to use patch with ticket #2070 [1] to be able to upload big
files and have a progress bar, and I can't quite figure out how to
make it work...

I'm also using 2 snippets [2] and [3]. Then, here's my simple view and
template:

View
-------

def frontpage(request):
    if request.method == 'POST':
        # [????] I don't know what to put there!...
    else:
        form = UploadForm()

    return render_to_response('frontpage.html',
                              { 'form': form },
 
context_instance=RequestContext(request))

Template
-------------

[insert javascript from snippet [3] here]

 <FORM action="."
       enctype="multipart/form-data"
       method="post">
{{ form }}
   <INPUT type="submit" value="Send">
 </FORM>


Settings
-----------
from django.conf import global_settings
FILE_UPLOAD_HANDLERS =
('upload.upload_handler.UploadProgressCachedHandler', ) +
global_settings.FILE_UPLOAD_HANDLERS

The form just contains a file input. When I press submit,  I enter the
view again but I don't know what code to put in that view to replace
the [????] thing above. Should that code wait for the end of the
upload before returning anything, and if so, how?

I couldn't find any help on the ticket page or on this mailing list.
Can you see what I'm missing to make it work?

Many thanks!

Julien


[1] http://code.djangoproject.com/ticket/2070
[2] http://www.djangosnippets.org/snippets/678/
[3] http://www.djangosnippets.org/snippets/679/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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