0

I have written a java servlet that uploads multiple files, I used cURL to upload the file

curl -F filedata=@myfile.txt http://127.0.0.1/test_Server/multipleupload this uploads the file to a folder uploads that is located in the webapps folder. I'm in the middle of writing a python module that can be used instead of curl, the reason being this server is going to be used by a build farm so using cURL is not an option and the sane goes for using pycURL. The python module I'm working on was previously written for doing this on pastebin , so all i'm doing is editing this to use my server and it looks like urllib doesn't do multipart/form-data?. If anyone could point me in the right direction it would be great, I haven't posted the code but if anyone wants it I will do so, There isn't much in that code as a start all I did was changed teh URL to my server and thats when I found out that its using application/x-www-form-urlencoded (Thank you Wireshark ! )

cyberbemon
  • 3,000
  • 11
  • 37
  • 62
  • possible duplicate of [Using MultipartPostHandler to POST form-data with Python](http://stackoverflow.com/questions/680305/using-multipartposthandler-to-post-form-data-with-python) – Martijn Pieters May 22 '12 at 09:43

1 Answers1

1

You can use the Request-class to send your own headers. Maybe you wanna use requests, it makes life easier.

EDIT: uploading files with requests

dav1d
  • 5,917
  • 1
  • 33
  • 52