curl-users
Curl file upload to Django framework fails
Date: Thu, 29 Oct 2009 10:42:44 +0100
Hi all,
I'm trying to upload files using Curl to a Djangobased form. ((I'm using
Django v1.1, but also tested with the development version). The form is
very simple:
<form name="receiver" method="post" enctype="multipart/form-data"
action="/receiver/">
<input type="file" name="data" />
<input type="submit" name="submit" value="go" /
</form>
I try to upload files using the information in section 4.3 of the docs
using:
curl -F data=@<filename goes here> -F submit=go http://<my submit url>
but then no file is uploaded. If I try to post the same info using perl and
LWP, or a browser displaying the form above, I do receive the file in the
framework. Could anyone point me at how to upload a file using curl
correctly, including the name of the upload field?. The file I try to upload
is just plain text. I'm running Apache/WSGI to serve the Django pages,
however I get the same result using other server combinations.
Vid
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-10-29