Hi
I have created a file on the fly, stored content in the file and saved it on the server for backup purposes.
Now I need to (in the same piece of script) push that file to the browser for saving - how would this be achieved?
$newhandle = fopen("my_folder/my_file.txt", 'w') or die("fails");
fclose($newhandle);
if (!$handle = fopen("my_folder/my_file.txt", 'a')) {
echo "Failed";
}
if (fwrite($handle, "my content goes here") === FALSE) {
echo "Failed";
}
thanks for reading