Forum Moderators: coopster

Message Too Old, No Replies

Cronjob that'll dl to server

         

mattyb515

7:45 pm on Apr 25, 2006 (gmt 0)

10+ Year Member



I'm looking to have the script that I've made auto dl in a cron job to our webserver. I can get the script to work perfectly so that a window pops up and it gives you the option to save to the hard drive but I want it to save to the webserver instead.

header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=BSDailyOrders".date("Y-m-d").".xls");

Those are the header statements that relates to it but I have no idea how to get it to autodownload to the server. Any thoughts?

hakre

7:56 pm on Apr 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the headers are to give hints to the client but this time your script is the client.

checkout php for curl functions or file functions. curl is a http specific lib and the file functions do support http/ftp through php file wrappers. you need your script to use such functions to download the file from somewehere to your server then.

--hakre

mattyb515

2:23 pm on Apr 28, 2006 (gmt 0)

10+ Year Member



Thanks hakre,

I've looked into cURL and I actually think the easiest way to do this might be with fopen() fwrite(), etc. Now I just have to go through and redo the code a little.