in reply to Re^2: How to change content-length in CGI
in thread How to change content-length in CGI

Could this be another binmode issue? Try adding a binmode FH right after opening your file. You could also print out the length of $Data right before you post it to make sure it's the size you're expecting.