can anyone know on how could I force to download a file without displaying DialogBox (Open/Save). The below code was is my test script to download created excel file but the dialog box appears to download a file.
$filename ="excelreport.xls";
$contents = "testdata1 \t testdata2 \t testdata3 \t \n";
header('Content-type: application/ms-excel');
header('Content-Disposition: attachment; filename='.$filename);
echo $contents;
I want to automatically download file and save it on specified directory without dialog box
You can force to download instead of showing it but I think it is not possible to force the browser in general to download it without a prompt
Source: php.net