cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Rookie post question with php action

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 2 Sep 2003 13:00:19 +0200 (CEST)

On Mon, 1 Sep 2003, David Plunkett wrote:

> curl -F userfile=@/FoxServ/curl/README -F press=OK
> http://localhost/post_tst.html

You will send the POST to the given URL. This URL ends with .html as noted
above.

> <form method="POST" enctype='multipart/form-data' action="post_action.php"
> ID="Form1">
> <input type=file name=userfile ID="File1">
> <input type=submit name=press value="OK" ID="Submit1">
> </form>

This <form> tag clearly shows that the HTLM says the POST should be sent to
post_action.php, not post_tst.html.

> Is this expected?

Your server was friendly enough to return the contents of the given URL, even
though you used POST and sent off a multipart post to the wrong URL...

> How can I confirm that my post_action.php is ever called?

It is only "called" if you specify that to curl. curl does not interpret any
HTML to figure where to send the data. You need to tell it.

> The only debugging I tried is using trace. --trace appears to show a
> connection and the file being sent.

Yes. To the wrong URL!

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-02