curl-users
Cannot upload file via http
Date: Fri, 16 Jan 2004 10:40:17 -0600
Hi,
I'm attempting to upload a file via http. I wanted to use the "-F" option
to do this however it doesn't seem to be working at all or I'm using it
incorrectly. I've also used the "-d" option and tried posting directly to
the MailboxServlet but it generates errors.
Here is what formfind.pl shows when running formfind.pl
https://www.testsite.com/cehttp/html/upload.htm
--- FORM report. Uses POST to URL "/cehttp/servlet/MailboxServlet"
Input: operation=UPLOAD (HIDDEN)
Input: data_format=B (RADIO)
Input: data_format=A (RADIO)
Input: mailbox_id (TEXT)
Input: batch_id (TEXT)
Select: put_flag
Input: trigger_flag (CHECKBOX)
Input: sourcefile=testfile (FILE)
Input: Submit (SUBMIT)
--- end of FORM
Here is my curl command using the -d option going directly to the
MailboxServlet script
curl -b /tmp/cookietest2 -L -d operation=UPLOAD -d data_format=A -d
mailbox_id=BOBSMITH -d batch_id=TEST_FILE -d put_flag=ignore -d
sourcefile=/home/bsmith/TEST_FILE
https://www.testsite.com/cehttp/servlet/MailboxServlet
It generates this error
<HTML>
<HEAD><LINK rel="stylesheet" type="text/css" name="defaultstyle"
href="/cehttp/html/style.css">
<TITLE>Servlet Response Message</TITLE></HEAD>
<H2 align=center>The following information has been returned.<H2>
<HR>
Your HTML page format is incorrect.
<HR>
</BODY></HTML>
Here is my curl command using the -F option going directly to the user form
curl -b /tmp/cookietest2 -L -F operation=UPLOAD -F data_format=A -F
mailbox_id=BOBSMITH -F batch_id=TEST_FILE -F put_flag=ignore -F
sourcefile=@/home/bsmith/TEST_FILE -F Submit=Submit
https://www.testsite.com/cehttp/html/upload.htm
It generates this error
curl: (56) Received problem in the chunky parser
Here is what I'm running
curl 7.9.8 (i686-pc-linux-gnu) libcurl 7.9.8 (OpenSSL 0.9.6b) (ipv6 enabled)
on RedHat Linux 8 kernel 2.4.20
Any help with this matter would be greatly appreciated.
Thanks,
Chris
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-01-16