curl-users
RE: Curl and Multiple File Downloads, again
Date: Thu, 27 Oct 2005 10:47:56 -0400
>> curl -c cookiejar -b cookiejar -F
>> "SEXPORT=Copyout&TOOL_NAME=GENERIC_UNIX&RECTYPE=DOCUMENT&RECNAME=TTPR-01.10.04-RR45096%7E15090&RECALT=C&RECVER=110>&LASTFILENAME=2220050-6MK14_20134_5212.CSV&XOPAL=XOPAL&STAGROW=EXISTINGFILE&UNIXALIAS=2220031-5-MK14_20004_5021_R2.CSV&ALIAS=2220031-5-MK14_2
>> 0004_5021_R2.CSV&SFILEDESC=5021%2C+R2%2C+8-9-05&START_TOOL=Y&SFILEUPLOAD=&UNIXALIAS=2220031-5MK14_20004_>5021D1R1.CSV&ALIAS=2220031-5MK14_20004_5021D1R1.CSV&SFILEDESC=5021%2C+D1R1%2C+8-9-05&START_TOOL=Y&SFILEUPLOAD=&UNIXALIAS=2220051-7_20043_5193.CSV&ALIAS >
>> =2220051-7_20043_5193.CSV&SFILEDESC=5193%2C+8%2F2%2F05&START_TOOL=Y&SFILEUPLOAD="
>> "https://www.foo.bar/pdmnet-bin/cgfiles.sh"
>I very much doubt that is a query string that your browser would send for a
>form like that. A multipart formpost form is quite different from an ordinary
>form, and thus each separate field must be sent with a separate -F use to
>create the full multipart post.
As suggested above, I used multiple -F "name=value" and the post worked, in that I don't get an application error. However, I'm not getting the data. An example stream of 2 files would look like:
----SWEBOUNDARY
Set-Cookie: myLockSetCookie=2220031-5-MK14_20004_5021_R2.CSV; path=/; ----SWEBOUNDARY
Content-type: application/CSV
Content-Disposition: attachment; filename="2220031-5-MK14_20004_5021_R2.CSV"
.....
DATA
DATA
DATA
......
----SWEBOUNDARY
Set-Cookie: myLockSetCookie=2220031-5MK14_20004_5021D1R1.CSV; path=/; ----SWEBOUNDARY
Content-type: application/CSV
Content-Disposition: attachment; filename="2220031-5MK14_20004_5021D1R1.CSV"
........
DATA
DATA
DATA
.......
----SWEBOUNDARY
Set-Cookie: myLockSetCookie=RESET; path=/;
----SWEBOUNDARY--
Content-type: text/html
<html><head><title></title></head>
<body bgcolor=white>
All files successfully downloaded
</body></html>
I seem to get only the html back following the Content-type: text/html. Would the data prior to that be in response headers? I seem to only get one header that indicates Transfer-encoding: chunked. Should I expect the downloaded file data to be in the same response stream as the <html>?
Regards,
Gary Huntress
Code 4113
Naval Undersea Warfare Center
Newport, RI 02841
1-800-669-6892 x28990
Received on 2005-10-27