Jump to content

Recommended Posts

I have sequence of operation so using CURL I am doing but in last step of my sequence I need to download one file.

 

when I refer same url in any browser

it will open regular  Open,save dialog box(force -download dialog like you want to save or open in any application)

 

Now my question is How can I download file using CURL in my local host  without providing response in that dialog box.(If in dialog box I say save then It will save but I want this thing using CURL)

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/105965-php-curl-problem/#findComment-544537
Share on other sites

Hello friends

 

 

Most of the part solved now only one question

If I want to POST

following kind of data  but I am not able to post array It is not passed

 

My Post data

Array

(

    [filetype] => tab

    [cateogry] => ALL

    [manufacturer] => ALL

    [invtype] => both

    [columndata] => Array

        (

            [0] => sku

            [1] => sdesc

            [2] => qty

            [3] => price

            [4] => map

            [5] => mrp

            [6] => mfgn

            [7] => mfg

            [8] => upc

            [9] => cat

            [10] => wt

            [11] => fdesc

            [12] => acc

            [13] => pi

            [14] => wa

            [15] => ti

            [16] => imgpath

            [17] =>

            [18] =>

            [19] =>

            [20] =>

            [21] =>

        )

 

    [input] => SUBMIT

)

 

and Post String

 

filetype=tab&cateogry=ALL&manufacturer=ALL&invtype=both&columndata=Array&input=SUBMIT

 

See in above string I am not able to post

 

columndata=Array

 

 

Thanks

dip solution

 

Link to comment
https://forums.phpfreaks.com/topic/105965-php-curl-problem/#findComment-544570
Share on other sites

serialize() not works because

foreach ($post as $var => $val) {
if($var=="columndata")
	$postFields[] = "$var=".urlencode(serialize($val));
else		
	$postFields[] = "$var=$val";
}

curl_setopt($conn, CURLOPT_URL, $url);
curl_setopt($conn, CURLOPT_POST, count($post));
curl_setopt ($conn, CURLOPT_POSTFIELDS, join("&",$postFields));
$page = curl_exec ($conn);

Link to comment
https://forums.phpfreaks.com/topic/105965-php-curl-problem/#findComment-544585
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.