madhavvyas Posted May 16, 2008 Share Posted May 16, 2008 Hello Friends I have one question regarding CURL Using CURL how can we prevent Download dialog (normally we got from application/force download) How to bypass that dialog using CURL It is really urgent Message me in dipsolution@yahoo.com Quote Link to comment https://forums.phpfreaks.com/topic/105965-php-curl-problem/ Share on other sites More sharing options...
Orio Posted May 16, 2008 Share Posted May 16, 2008 I don't understand your question. What does your script currently do, and what exactly is problematic and needs to be fixed? Orio. Quote Link to comment https://forums.phpfreaks.com/topic/105965-php-curl-problem/#findComment-543058 Share on other sites More sharing options...
madhavvyas Posted May 19, 2008 Author Share Posted May 19, 2008 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) Quote Link to comment https://forums.phpfreaks.com/topic/105965-php-curl-problem/#findComment-544537 Share on other sites More sharing options...
DarkWater Posted May 19, 2008 Share Posted May 19, 2008 What kind of file is it? (That shouldn't really matter, but the more information the better). Also, can we see what you have so far. Quote Link to comment https://forums.phpfreaks.com/topic/105965-php-curl-problem/#findComment-544538 Share on other sites More sharing options...
MadTechie Posted May 19, 2008 Share Posted May 19, 2008 Get the url that prompts for the force download and use file_put_contents("myfile.dat",file_get_contents($url)); Quote Link to comment https://forums.phpfreaks.com/topic/105965-php-curl-problem/#findComment-544539 Share on other sites More sharing options...
madhavvyas Posted May 19, 2008 Author Share Posted May 19, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/105965-php-curl-problem/#findComment-544570 Share on other sites More sharing options...
DarkWater Posted May 19, 2008 Share Posted May 19, 2008 You can use serialize(). Quote Link to comment https://forums.phpfreaks.com/topic/105965-php-curl-problem/#findComment-544572 Share on other sites More sharing options...
madhavvyas Posted May 19, 2008 Author Share Posted May 19, 2008 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); Quote Link to comment https://forums.phpfreaks.com/topic/105965-php-curl-problem/#findComment-544585 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.