cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl https file upload output

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Fri, 16 Nov 2007 12:07:19 -0600

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?? I've done that lots of times and it works perfectly...

Ralph Mitchell
Received on 2007-11-16