Page 1 of 1

Get file from website with PHP

Posted: Mon Apr 09, 2012 8:53 pm
by vhiguita
Hi,

I need to know how could I download (kayak-fra-lax-20120423.csv) a file from the website http://www.kayak.com/#/flights/FRA-LAX/2012-04-23 using php. I am doing it with the next code.

<?php


header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"kayak-fra-lax-20120423.csv\"");
//$data="col1, col start and end col2,col3, \n";
//$data .= "seond linedata here from site to download col1";
//echo $data;

?>
But it shows me a new one.

Thanks in advance.

Re: Get file from website with PHP

Posted: Mon Apr 09, 2012 8:58 pm
by Celauran
Have you looked at cURL?

Re: Get file from website with PHP

Posted: Mon Apr 09, 2012 10:11 pm
by requinix
You can copy it to your server as long as you have the actual path to the CSV file (which that URL you posted is not).