After some testing i think that the prob occurs because from the same view 
I render another one form in the same template. This form is not 
multi-part. In this case it happens what I describe. If i put this simple 
form in comments (in views and in template) the multipart form uploads the 
file normally. Isn't it possible to handle these 2 forms in the same view?
 This is what I do:
def upload(request):
    c = {}
    c.update(csrf(request))

    if "vehicle-form" in request.POST:
        form = VForm(data=request.POST, own_id=u_id)
        print form.is_valid()
        if form.is_valid():
            form.save()
            return render_to_response('bingo.html', locals(), 
context_instance= RequestContext(request))
    else:
        form = VForm()
        
    if "doc-form" in request.POST: 
        form = LicenceForm(data=request.POST, files=request.FILES)
        if form.is_valid():
            handle_uploaded_file(request.FILES["docpath"])
            form.save()
            return render_to_response('success.html', locals(), 
context_instance=RequestContext(request))
    else:
        form = LicenceForm()

    return render_to_response('upload.html', locals(), context_instance= 
RequestContext(request)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ooVRu6HoGwcJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to