cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Unable to post a form using curl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 24 Apr 2010 11:00:49 +0200 (CEST)

On Fri, 23 Apr 2010, Fabien Chebel wrote:

> I have a small html page with a simple form :

>> method="post" enctype="multipart/form-data">

> curl -F upload=@/patch/to/my/video.mp4 -F token="AIwbFAT...g" -F button="OK"
> http://website.com/path/to/my/page.html

First, you need to educate yourself on the basics:

         http://curl.haxx.se/docs/httpscripting.html

A URL ending with .html is *very* seldomly the actual URL you upload to. It is
often the URL that holds the form you act on, but that's completely different.

You most likely also need to login first and keep cookies around and use them
in the actual upload.

See the LiveHTTPHeaders help hints we often suggest here and in the docs
mentioned above.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-24