Posting gzip'd image file - server says Malformed Upload?

Chris Angelico rosuav at gmail.com
Wed Jun 17 23:56:08 EDT 2015


On Thu, Jun 18, 2015 at 1:48 PM, Paul Hubert <phbrt25 at gmail.com> wrote:
>> # Now:
>> gz = '/Users/Paul/Desktop/scripts/pic.jpg.gz'
>> with open(dafile, 'rb') as f_in, gzip.open(gz, 'wb') as f_out:
>>     f_out.write(f_in.read())
>>
>
> Same result - server says malformed upload. :/

Oh well, was worth a shot. Since the file's sitting around still, you
should be able to attempt to decompress it with the stand-alone gzip
command; does that give the right result? Also, you should be able to
manually send that .gz file up to the server, which would be worth
confirming.

Are you certain that the content should be gzipped as a file? It's not
meant to be done as a transfer-level encoding?

ChrisA



More information about the Python-list mailing list