in reply to Re: CrLf getting inserted into an octet-stream (gzip file)
in thread CrLf getting inserted into an octet-stream (gzip file)

Thanks Corion
Setting binmode would do it, but I'm trying to write some cleaner code and use the content_file parameter
I've changed my post call to
my $response = $ua->post( $url, ':content_file' => '.\test.gz', Content_Type => 'form-data', Content => [ userid => 'USERID', password => 'PASSWORD', recordlength => '', recordterminator => 'NONE', remotefilename => 'REMOTE_FILENAME' ] );
However, I'm not getting the test.gz file written out. I figure I'm doing (or not doing) something stupid, but I'm not seeing it.
So I'm apprealing to the monks again to help me past my stupidity.
Thanks for you help, though.

Replies are listed 'Best First'.
Re^3: CrLf getting inserted into an octet-stream (gzip file)
by Corion (Patriarch) on May 23, 2008 at 17:16 UTC

    Most likely, the current directory is not what you think it is, or the user your program is running as has not sufficient rights to write to the file.

    Consider using an absolute path to save the file. That way you become independent of what the current directory is.

    As an aside, you might want to be careful when using backslashes. In most cases, you can use forward slashes even on Windows, and forward slashes don't have the danger of getting interpreted as escapes:

    ':content_file' => 'c:/temp/test.gz',
      Absoluted the path (with forward slashes) and I know I have rights to the directory (I have admin rights to the box).

      Oh well, I'll go the long route.

      Thanks again for your help.

        Is the web server running as the same user as you think it is? Take a look at the discussion on Web Browser fails to compile my code.

        Update: Quite right. Poor reading on my part.

        --MidLifeXis