cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl https file upload output

From: Richard Vasquez <rickv_at_gmx.de>
Date: Mon, 19 Nov 2007 20:07:18 +0100

-------- Original-Nachricht --------
> Datum: Fri, 16 Nov 2007 12:07:19 -0600
> Von: "Ralph Mitchell" <ralphmitchell_at_gmail.com>
> An: "the curl tool" <curl-users_at_cool.haxx.se>
> Betreff: Re: curl https file upload output

> On Nov 15, 2007 8:39 AM, Richard Vasquez <rickv_at_gmx.de> wrote:
>
> > Hi,
> > When I run the following from the command line...
> >
> > % curl -F upload=@file -u test_usr:test_pwd -F press=Upload
> > https://some.server.org/ >/dev/null
> > % echo $?
> > 0
> >
> > ...everything looks fine and the file uploads as I wish.
> >
> > but when I submit what I thought was the same command via a script like
> > this...
> >
> > ### begin UNIX script
> > #!/bin/ksh
> >
> > file=$1
> >
> >
> > CURL_CMD="curl -F upload=@$file -u test_usr:test_pwd -F press=Upload
> > https://some.server.org/ >/dev/null"
> >
> > `$CURL_CMD`
> > RET=$?
> > echo $RET
> > ### end UNIX script
>
>
> Is there some mystical reason for not just putting:
>
> curl -F upload=@$file -u test_usr:test_pwd -F press=Upload
> https://some.server.org/ >/dev/null
> RET=$?
>
> in your script??

The script builds the command based on arguments given. One of the args is protocol type. I have 3 different cases so instead of having 3 seperate scripts I only have one.

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
Received on 2007-11-19