У меня есть этот скрипт для принудительной загрузки файла в php, но его не работает. файл все еще открывается на странице. Помогите мне понять, что не так.Force file download in php не работает
<?php
$orderid=sql_prep($_GET['oid']);
if(isset($_POST['file'])){
$file = $_POST['file'];
header("Content-Description: File Transfer");
header("Content-Transfer-Encoding: Binary");
header("Content-Type: application/octet-stream");
header('Content-Disposition: attachment; filename="'.basename($file).'"');
readfile('attachments/'.$orderid.'/user/'.$file);
}
?>
<form action="" method="POST" name="dwnld" >
<input name="file" value="<?php echo $file['filekey']; ?>" type="hidden">
<button type="submit"> <?php echo $file['filename']; ?> </button>
</form>
'die()' после 'readfile()'. NO OUTPUT после отправки файла – fusion3k
он решен, еще? –
это только файлы в формате pdf? или любые файлы типа –