On Mon, Aug 22, 2016 at 11:00 AM, Michal Petrucha
<michal.petru...@koniiiik.org> wrote:
> On Mon, Aug 22, 2016 at 10:11:49AM -0400, Larry Martell wrote:
>> When I get the request, request.FILES is empty. Yet the content type
>> is multipart/form-data and the method is POST:
>>
>> (Pdb) print request.META['CONTENT_TYPE']
>> multipart/form-data;
>> boundary="boundary_.oOo._NzEwNjIzMTM4MTI4NjUxOTM5OQ==MTY2NjE4MDk5Nw=="
>>
>> (Pdb) print request.META['REQUEST_METHOD']
>> POST
>>
>> (Pdb) print request.FILES
>> <MultiValueDict: {}>
>>
>> The individual files are being sent with content-type
>> 'application/octet-stream', and it looks like I get the contents of
>> the files converted to unicode:
>>
>> (Pdb) 
>> type(request.POST['right-carotidartery:63B2E474-D690-445F-B92A-31EBADDC9D93.png'])
>> <type 'unicode'>
>
> Are you certain the request contains correct headers for files? In
> particular, look at the “Content-Disposition” header; for each file,
> it should contain the “filename” attribute; otherwise, Django will
> treat it as a regular (non-file) form field [1]. As an example, the
> header could look like this::
>
>     Content-Disposition: form-data; name="file"; filename="filename.png"

How would I access the Content-Disposition for each file? In the
headers for the request that field does not exist.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY6Vp7uGu1982X7mmGMFk%3DxKzK240d8QbwgXV2-qnOkYyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to