Opened 17 years ago
Closed 17 years ago
#5928 closed (worksforme)
form cleaned_data does not have uploaded request.FILES content
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
I've file uploading in my project for a while now and it worked pretty fine.
But after not testing it for a while it seems that since a more or less recent django svn version
things stopped working. My code is like this:
print request.FILES # files have <content omitted> printed request.POST.update(request.FILES) print request.POST # same as above, content is there form = TestForm(request.POST) if form.is_valid(): # form.cleaned_data does not contain content anymore
I've tried some things and I can only think of a bug in django.
Note:
See TracTickets
for help on using tickets.
Or perhaps things have changed that your code needs to adjust to. Current doc here describes passing request.FILES in when constructing the form:
http://www.djangoproject.com/documentation/newforms/#binding-uploaded-files-to-a-form
It's marked new in development version so maybe it used to be done via the request.POST.update? I don't know, but I do know uploading files works for me using the method described in the doc, as of a very recent checkout.