I have a basic form
<form name="ImageUploadForm1" method="post" action="URLTOPOSTTO"
id="ImageUploadForm1" enctype="multipart/form-data">
<input name="ImageToUpload" type="file" id="ImageToUpload" size="24" />
<input type="submit" name="ButtonUpload" value="Upload" id="ButtonUpload" />
I want to post the file using curl. So far i have succeeded in uploading an
empty file ... dunno why. Here is my code (in C# but i assume in c++ wont be
very different):
Easy easy = new Easy();
easy.SetOpt(CURLoption.CURLOPT_URL, "URLTOPOSTTO");
easy.SetOpt(CURLoption.CURLOPT_FOLLOWLOCATION, 1);
easy.SetOpt(CURLoption.CURLOPT_POST, 1);
easy.SetOpt(CURLoption.CURLOPT_COOKIEJAR, "cookies");
easy.SetOpt(CURLoption.CURLOPT_COOKIEFILE, "cookies");
easy.SetOpt(CURLoption.CURLOPT_USERAGENT, "Mozilla/5.0 (Windows;
U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6");
easy.SetOpt(CURLoption.CURLOPT_POSTFIELDS, "ImageToUpload=" + "
BASEBALL.MPG&ButtonUpload=Upload");
easy.Perform();
easy.Cleanup();
This code sends the proper headers (i think) but the file i upload is empty.
I assume i am missing a point ... Help! Probably need to load the file
content in the postfields???
_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2007-02-03