|
1
|
There is a way to upload file with standard python libraries (urllib, httplib, ...) as explained at http://code.activestate.com/recipes/146306/. But that didn't worked for me for binary data. I didn't liked/tried solution explained at http://fabien.seisen.org/python/urllib2_multipart.html, so I tried with pycurl (http://pycurl.sourceforge.net/ wrapper for http://curl.haxx.se/libcurl/) because it is std. lib for php, and uploading the file is very simple (just add @<path-to-file> to post variable value). It was a little hard to find proper way because there is no such example or documentation. But I found it, and it is so simple ;) I supply django test application which receives file that is uploaded.
|
1 comment
Add a comment
Sign in to comment

Download
Copy to clipboard

Heh, it seems that there is documentation how to do it: http://pycurl.cvs.sourceforge.net/pycurl/pycurl/tests/test_post2.py?view=markup