Hello,
I'm trying to upload images to http://imageshac.us via a Python script.
I have looked at the POST request with HTTPLiveHeaders Firefox
extension when I upload an image, but I can't figure what's wrong. (if
I disable the cookies in the browser, it still works, so it's not
that).
When I tr
I forgot to add that I'm behind a proxy, but I think that is
irrelevant.
If you are not behind a proxy replace this line:
print post_multipart('proxy-a.mains.nitech.ac.jp', 8080,
'http://imageshack.us/index.php', params, files)
with
print post_multipart('imageshack.us', 80, '/index.php', params
Ok, I solved it with the unvaluable help of a nice guy in the #python
channel.
It is a studid as it gets, replaced
files = [('fileupload', 'b.jpg', open('b.jpg').read())]
by
files = [('fileupload', 'b.jpg', open('b.jpg', 'rb').read())]
because binary files are not opened correctly in Windows X