cURL / Mailing Lists / curl-users / Single Mail

curl-users

Unable to post a form using curl

From: Fabien Chebel <bach912_at_gmail.com>
Date: Fri, 23 Apr 2010 22:03:29 +0200

Hello everyone,

I have a small html page with a simple form :

<form action="
> http://uploads.gdata.youtube.com/action/FormDataUpload/AIwbFAQ...g?nexturl=http%3A%2F%2Fwww.google.com"
> method="post" enctype="multipart/form-data">
> <input type="file" name="upload" />
> <input type="hidden" name="token" value="AIwbFAT...g" />
> <input type="submit" name="button" value="OK" />
> </form>

(the form "action" and the token value are truncated in this email for an
easier reading)

My goal is to upload a video file to youtube using the Youtube API . If I
load the page in any web browser, the upload is working and I'm redirected
to google.com

Now when I try to post this form using cURL, cURL only returns the source of
this html page and the video doesn't appear in my youtube videos. Here is
the command line I use :

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

I don't understand what's wrong in that command line.

I'm using the Server edition of Ubuntu Intrepid (8.10) and here's the output
of "curl -V" :

curl 7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g
zlib/1.2.3.3libid n/1.8
> Protocols: tftp ftp telnet dict ldap ldaps http file https ftps
> Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
>

Thanks for you help,

Fabien Chebel

-------------------------------------------------------------------
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-23