header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=Download.csv");
this code helps me to download the csv file when i run my script in the browser.
But now instead of downloading the file , is it possible to save a file directly in folder ,
I mean how can i modify the code so that when my scripts run it should safe the csv file instead of prompting the user to download it .
For example: This code will create file in the directory.
$ourFileName = "testFile.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
likewise how can i modify the header Content-Disposition so that it will create csv file in folder.
any help will be appriciated.
Thanks