cURL / Mailing Lists / curl-users / Single Mail

curl-users

Multipart Forms and File Downloads

From: Huntress Gary B NPRI <HuntressGB_at_npt.nuwc.navy.mil>
Date: Tue, 25 Oct 2005 09:02:03 -0400

I'm having trouble using curl to post to a multipart/form-data form.

The form contains multiple rows that correspond to files the user can choose to download (not upload). Each row starts with a checkbox. The user checks multiple boxes and when the form is submitted then multiple downloads are initiated. That is, if I check 5 boxes, 5 files are downloaded when I post the form.

An example row is:

<TR><TD><INPUT TYPE="CHECKBOX" NAME="STAGROW" VALUE="EXISTINGFILE">
 <INPUT TYPE=HIDDEN NAME="UNIXALIAS" VALUE="2220031-5-MK14_20004_5021_R2.CSV">
 <INPUT TYPE="HIDDEN" NAME="ALIAS" VALUE="2220031-5-MK14_20004_5021_R2.CSV"></TD>
 <TD>2220031-5-MK14_20004_5021_R2.CSV&nbsp;</TD>
 <TD><INPUT NAME="SFILEDESC" VALUE="5021, R2, 8-9-05";></TD>
 </TR>

If I encode the form parameters normally and submit them using -d "STAGROW=EXISTINGFILE&...." the server seems to reply that I have not checked any boxes.

Can curl support multiple file downloads from multipart forms? If so, do I submit my form data using -d ?

Thanks!
Regards,

Gary Huntress
Code 4113
Naval Undersea Warfare Center
Newport, RI 02841
1-800-669-6892 x28990
Received on 2005-10-25