curl-users
RE: Having trouble uploading a file using cURL
Date: Thu, 21 Jun 2001 12:40:10 -0500
This is going to be very messy!
Below is the output of curl. I would let you see and test but I am on a
secure intranet.
Where the ||| are I am attempting to write the form response of File1= but
there is nothing there. My guess is the ASPSimpleUpload is not working well
with cURL?
Kevin,
As for using another application/object to do it, I think I want to do it
the most robust way. I will be sending ~ 25,000 Txt files @ ~20K each over
a 24 hour period. Currently I am doing this through Header information
using httpccmd.exe and converting the output on the server with asp. While
this works, it is very slow and CPU intensive.
Chad
****************************************************************************
*********************************
C:\Chad\test>curl -v -i -F File1=@c:\temp\Drives.txt -F "submit=Upload0Now"
XXXXXXX.com/upload/Example1.asp
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Thu, 21 Jun 2001 17:25:14 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Thu, 21 Jun 2001 17:25:14 GMT
Content-Length: 355
Content-Type: text/html
Set-Cookie: ASPSESSIONIDQGGGQTUO=DPMCHAJADEELDKBPCIGMHJMA; path=/
Cache-control: private
||| |||||| |||
<html><head><title>ASP Simple Upload Example #1</title></head></title>
<body>
<form method="POST" action="Example1.Asp" enctype="multipart/form-data">
Select a file to upload: <input type="file" name="File1" size="30">
<input type="submit" name="submit" value="Upload Now">
</form>
</body>
</html>
C:\Chad\test>pause
Press any key to continue . . .
C:\Chad\test>curl -v -i -F File1=@c:\temp\Drives.txt -F "submit=Upload0Now"
XXXXXXXX.com/upload/Example1.asp
* Connected to XXXXXXXXXXXXXXXXXXXXXXXXXXX)
> POST /upload/Example1.asp HTTP/1.1
User-Agent: curl/7.8 (win32) libcurl 7.8
Host: XXXXXXXXXXXXXXX.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 2063
% Total % Received % Xferd Average Speed Time
Curr.
Dload Upload Total Current Left
Speed
103 2420 100 355 103 2142 843 5087 0:00:00 0:00:00 0:00:00
2065
* Connection (#0) left alive
* Closing live connection (#0)
C:\Chad\test>pause
Press any key to continue . . .
****************************************************************************
*********************************
-----Original Message-----
From: Roth, Kevin P. [mailto:KPRoth_at_MarathonOil.com]
Sent: Thursday, June 21, 2001 12:17 PM
To: HAMPY, CHAD (SBCSI); curl_at_contactor.se
Subject: RE: Having trouble uploading a file using cURL
Chad:
If you're looking for alternative tools to ASPSimpleUpload, I highly
recommend Software Artisans' SAFileUp tool. They've got a nice array of
client tools (Java, ActiveX) that go along with it if you're doing any
serious file uploads. Otherwise, they also support standard Forms-based
uploads like you're trying. They've also got a reasonably good set of
documentation to show you how to use the tool. I am not related to the
company, just a happy user. http://www.softarts.com/
However, if you are able to successfully upload using a browser, but not
via curl, then the problem lies with curl (or your use of it).
My first guess is that you're possibly having file security issues. But
that's just a wild guess.
If you can send me the output from your latest attempt with curl
(include the -v and -i flags so I can see the whole picture), I would be
happy to attempt to help.
--Kevin
-----Original Message-----
From: HAMPY, CHAD (SBCSI) [mailto:ch2938_at_sbc.com]
Sent: Thursday, June 21, 2001 11:46 AM
To: curl_at_contactor.se
Subject: RE: Having trouble uploading a file using cURL
First off, Thank you for the quick response!
I did get a response from the page with the new command string below,
but
the object is still not recognizing the form information. I am going to
look into setting up a CGI script/Page to upload to the server. Could
someone point me to either a good example or documentation on how to
setup a
CGI upload using IIS 5?
Chad Hampy
-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Thursday, June 21, 2001 9:18 AM
To: Curl Mailinglist
Subject: Re: Having trouble uploading a file using cURL
On Thu, 21 Jun 2001, HAMPY, CHAD (SBCSI) wrote:
> I have never used CGI before so I am trying to use a object called
> ASPSIMPLEUPLOAD
I know totally nothing about ASP so I can't help you on that part.
> <html><head><title>ASP Simple Upload Example
> #1</title></head></title>
> <body>
> <form method="POST" action="Example1.Asp"
> enctype="multipart/form-data">
>
> Select a file to upload: <input type="file" name="File1"
size="30">
> <input type="submit" name="submit" value="Upload Now">
> </form>
> </body>
> </html>
>
> Location of page:
> myserver.com/upload/Example1.asp
>
> Explanation:
> I am willing to ditch all of this work and try something new to get it
> working. Manual web-upload to the page works but I just cant seem to
get
it
> to work with cURL.
> curl -F File1=@c:\temp\Drives.txt -F press=Submit myserver.com
The correct commnad line to upload to that form should look something
similar
to:
curl -F File1=@c:\temp\Drives.txt -F "submit=Upload%20Now" \
myserver.com/upload/Example1.asp
> Above is the code I was using but there was no way to point it to
> Example1.asp
The curl command line must point out the exact URL to upload to.
-- Daniel Stenberg -- curl dude -- http://curl.haxx.se/Received on 2001-06-21