Thursday, September 30, 2010

Re: iPhone posting FILEs = "Invalid content length"

On 30 Sep 2010, at 11:55, Danny Bos wrote:
> Basically I've got an iPhone app sending a POST to a django app, it
> contains one FILE.
> Every now and then (very sporadically, about 1 in 5) one fails and I
> get the below message.

> <th>Exception Value:</th>
> <td><pre>Invalid content length: 0<pre></td>

> Any ideas?

This will be a problem with your Objective-C code on the iPhone. Can you paste the code you're using to build the HTTP request?

In want of that, I'd hazard that whatever method you're using to build the request body is returning nil, and that you're then assigning that as the request body. As such you're ending up with a content length of 0.

(Of course it could be something else entirely, but it doesn't sound like a Django issue per se.)

HTH

Regards,
Carlton

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment