Writing byte stream as jpeg format to disk

Navkirat Singh navkirats at gmail.com
Thu Aug 26 19:22:16 CEST 2010


Hey guys,

I am programming a webserver, I receive a jpeg file with the POST method.The file (.jpeg) is encoded in bytes, I parse the bytes by decoding them to a string. I wanted to know how i could write the file (now a string) as a jpeg image on disk. When I try to encode the same string to a bytes and write them in binary format to disk, the file is not recognized as jpeg. I would be grateful if someone could help me with this.


Regards,
Nav 


More information about the Python-list mailing list