cURL / Mailing Lists / curl-users / Single Mail

curl-users

Question on sending gzip file via HTTPS

From: <Woody.R.Gingery_at_dom.com>
Date: Mon, 4 Jun 2007 15:30:41 -0400

Curl-team,

In an earlier question on the same topic I had asked about how to specify
that a file being sent from our server to a client server is a binary file.
Based on the response, I added "type=application/octet-stream" to the file
name that is to be created at the receiving end. I also used the "verbose"
option on the curl command.

The gzipp'ed file did transfer but cannot be unzipped at the receiving end,
Winzip responds with an "Invalid archive directory" message. When I look at
the output log from our Perl/Curl script, with verbose I see a message that
says "Content-type: text/html". I'm assuming the file is still being
treated as a text file on the receiving end. Do both ends of the
transmission need to specify type=application/octet-stream for the binary
file?

(I assume the four messages immediately below are from our server end)
> Accept: */*

> Content-Length: 14602541

> Expect: 100-continue

> Content-Type: multipart/form-data;
boundary=----------------------------efc81c1d0bde

100 13.9M 0 0 100 13.9M 0 123k 0:01:55 0:01:55 --:--:--
404k
100 13.9M 0 0 100 13.9M 0 122k 0:01:56 0:01:56 --:--:--
338k
100 13.9M 0 0 100 13.9M 0 121k 0:01:57 0:01:57 --:--:--
264k< HTTP/1.1 200 OK

100 13.9M 0 0 100 13.9M 0 121k 0:01:57 0:01:57 --:--:--
200k< Server: Microsoft-IIS/5.0

(I assume these four messages are from the receiving server)

< Date: Thu, 31 May 2007 17:02:27 GMT

< X-Powered-By: ASP.NET

< Connection: close

< Content-type: text/html

(This is code from our Perl script)

$document_name = "xxxxxxxxxx$parm_month$parm_year.txt.gz;type=application
/octet-stream";
print "document being transferred is: $document_name\n";
$https = "
https:\/\/www.xxxx.xxxx.xx.us\/WebFX\/MainMenu\/Uploads\/UploadAFile\
/index.cfm?fuseaction=loginandinsertdocumentrecord";
   # setup the system call to curl, passing the appropriate flags
   # --fail suppress output so it dies nicely
   # --output says to direct the output to the file named in $ARGV[3]
   # $http_string is where the file name and https address are stored
@args = ("curl", '--fail', '-v', '-F', 'username=yyyyyyy', '-F',
'password=xxxx', '-F', 'documentname='.$document_name, '-F',
'expirationdate='.$expire_dat
e, '-F', 'Filecontents=@'.$source_file, '-F', "pbADD='Add new document
informati
on'", $https);

Thank you,
Woody
Tie line 8-650-5448
Outside 216-736-5448
Page 800-539-3021

-----------------------------------------
CONFIDENTIALITY NOTICE: This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect. The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it. Thank you.
Received on 2007-06-04