0

I want to user to be able to download a large CSV file as a stream, using curl. Code was working fine with small data. I have not found any information related rolling curl with XML as a post field data. If someone knows better solution to download large CSV file by calling API using curl please tell.

Here is my server code for on streaming download CSV file.

header("Content-type:text/octect-stream");
header("Content-Disposition:attachment;filename=".date('Y-m-d',time())."_search_results.csv");
echo $searchResults_xml_response;
unset($searchResults_xml_response);
spinkus
  • 7,694
  • 4
  • 38
  • 62
  • You curl data and then want to download it via an browser? Also have a look here http://stackoverflow.com/a/6520314/4916265 – JustOnUnderMillions Apr 20 '17 at 11:03
  • Yes, via browser. I am calling an api (different server) using curl and using that data creating file on streaming with above code. – Tejas Damre Apr 20 '17 at 11:07
  • Only as note: Currently your are parsing it to the brwsoer as content (you can see it in the browser), but you have to force that it will download for real (Browser->Download). but you should thing about that normaly files above a given size 100MB+ should not downloaded via a browser if possible. – JustOnUnderMillions Apr 20 '17 at 11:09
  • My problem is not to download the file, I can create a file by using response data in server and after that i will download it by calling its path. Please help me related rolling curl as I want to send multiple request at a time (in windows) using curl. – Tejas Damre Apr 20 '17 at 11:16
  • I mean download to the client (browser) not an the server where you download from an exernal source to the server. – JustOnUnderMillions Apr 20 '17 at 11:17

0 Answers0