cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Upload file through PHP app

From: jj <jj_at_macscripter.net>
Date: Mon, 02 Aug 2004 11:13:29 +0200

> On Mon, 2 Aug 2004, jj wrote:
>
>> And this is the shell script I use without success
>
> What exactly does "without success" mean? What curl version are you using?
>
> Remember that you can use --trace and --trace-ascii to get to see a full trace
> dump of the formpost.
>
> --
> Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
> Dedicated custom curl help for hire: http://haxx.se/curl.html

Mac OS X 10.3.4, curl version 7.10.2

The code:

curl -A 'Mozilla/4.0' -e 'http://scriptbuilders.net/upload.php'
-F 'author_name=TEST'
-F 'author_email=TEST'
-F 'author_url=TEST'
-F 'display_email=false'
-F 'script_name=TEST'
-F 'version=1'
-F 'osax=None'
-F 'requirements=None'
-F 'license=Freeware'
-F 'script_type=Editable'
-F 'selected_os[]=1'
-F 'board=45'
-F 'is_update=false'
-F 'MAX_FILE_SIZE=100000000'
-F 'short_desc=TEST'
-F 'description=TEST'
-F 'submit=foo'
-F 'file=@/Users/julifos/Desktop/test.sit'
'http://scriptbuilders.net/upload.php'
--trace-ascii ~/Desktop/trace.txt

A copy of 'trace-ascii' and 'trace', here:

http://homepage.mac.com/julifos/traces.zip

The trace seems OK, but the form is not sent, and the file is not uploaded.
The page I receive as answer is the same with the upload form, with the
fields filled with the provided values, and it should be a different page,
with a preview of the new entry in the database.

In the checkboxes I tried different things: true/false, 0/1, CHECKED...
Seems that true/false is OK (I tested the form in my private server and
checked the expected values, making a trace of received variables...) So, I
don't know if I'm missing something in this script... Apparently all is OK,
as I understand reading curl's man page and reading the trace files.
The action of the form is "", which I interpreted as "self", that is, the
same url where the upload.php is located.

Cheers!

jj

* Perhaps could exist a limitation in the server or php-form processing? I
added a "fake" user-agent, just in case, and a referer. I think cookies are
not required.

-- 
http://www.macscripter.net/
http://www.osaxen.com/
Received on 2004-08-02