Upload file with multipart/formdata

Skip Montanaro skip at pobox.com
Fri Nov 8 07:44:14 EST 2002


    Thomas> I want to upload a binary file with the script from:
    Thomas> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306

    Thomas> ASCII files get uploaded without problem, but binary data gets
    Thomas> cut before all 0xA1 bytes.

Just taking an educated guess since I can't get to ActiveState's website to
browse that recipe, but...

Open the file in binary mode, e.g.

    f = file("somefile", "rb")

-- 
Skip Montanaro - skip at pobox.com
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list