cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl file upload as a form field of a file made using tmpfile()

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 19 Apr 2010 13:14:04 +0200 (CEST)

On Mon, 19 Apr 2010, Ankur Chauhan wrote:
> I made a file using FILE* f = tmpfile();
>
> now i have written some data into it and I want to upload this to a url
> using POST along with other fields the form for the upload is as follows:

> <form method="post" action="upload.jsp">
> <input type="text" name="videoID" />
> <input type="file" name="F1" />
> <input type="submit" name="submit" />
> </form>

That's a highly unusual form to use for file uploads. But to answer your
question, you might want to do it similar to this:

         http://curl.haxx.se/libcurl/c/post-callback.html

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-19