Below code works perfectly to download the .html
file of a current PHP web page
$filename = 'filename.html';
header('Content-disposition: inline; filename=' . $filename);
header('Content-type: text/html');
Is there any way to save file in some specific location instead the download response.
Ex: if i want to save this filename.html
file in location /export/www/html/myproject/var/htmlpages
Tried below logic as alternative also:
ob_start();
file_put_contents('myfile.html', ob_get_contents());
But its generating empty file