cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

RE: Problem in posting filename=""

From: <rakesh.sharma2_at_wipro.com>
Date: Fri, 12 Dec 2008 12:18:35 +0530

Hi,
        Thank's for the promt reply
 
Actually when I am trying the following curl_formadd,
And then seeing the debug file, the form which is sent by curl
application has nothing like
That means curl has not made any form with null file name like in

Content-Disposition: form-data; name="name:_id11"; filename=""
Content-Type: application/octet-stream

Then, I tried with
curl_formadd(&formpost,
               &lastptr,
               CURLFORM_COPYNAME, "CarFinderForm:_id11",
                   CURLFORM_FILE,"",
                   CURLFORM_FILENAME,"",
                   CURLFORM_CONTENTTYPE ,"application/octet-stream",
               CURLFORM_END);
But it is giving me the error that filename is NULL

Actually the problem is I have to post the form data which has filename
filed as ""
Also, if we see the form with view souce to the actual page
It has name:_id11 as the filed name but no filename field is there in
the actaul page.

Thank's
Rakesh

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Dan Fandrich
Sent: Thursday, December 11, 2008 11:56 PM
To: curl-library_at_cool.haxx.se
Subject: Re: Problem in posting filename=""

On Thu, Dec 11, 2008 at 06:30:12PM +0530, rakesh.sharma2_at_wipro.com
wrote:
> My problem is that I have to post the Form-data as exactly same
> as i got from Live HTTP Header output.
> This is Live HTTP header output:
>
> Content-Disposition: form-data; name="name:_id11"; filename=""
> Content-Type: application/octet-stream
>
>
> -----------------------------1496212324596
> Can anyone sugget me how to do this with curl_formadd( )
>
> I am trying something like :
>
> curl_formadd(&formpost,&lastptr,
>
> CURLFORM_COPYNAME, "name:_id11",CURLFORM_COPYCONTENTS,"",
>
> CURLFORM_FILENAME,"filename",CURLFORM_COPYCONTENTS,"",
>
> CURLFORM_END);
>
> But not able to form the exact form data.

Well, what does that give you?

I'm able to replicate the output above with the curl command:

curl -F 'name:_idll=@/dev/null;type=application/octet-stream;filename='
\
  http://example.com/

You can look at formparse() in src/main.c to see how that builds the
form.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address
service
          Let webmasters know that your web site has moved
Please do not print this email unless it is absolutely necessary. 
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 
www.wipro.com
Received on 2008-12-12

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET