Я пытаюсь запустить php-скрипт для загрузки файлов из папки пользователя, передав путь к файлу php-скрипта, и я вижу, что он получает файл, но не скачивает.
<?php
set_time_limit(0);
$destino = 'uploads/'.$_GET['fd'].'/';
//this is where the file is
$arquivo ='teste.txt';//this is the test file to download
$arquivo = filter_var($arquivo, FILTER_SANITIZE_STRING);
$arquivo = basename($arquivo);
$caminho_download = $destino .$arquivo;
if (!file_exists($caminho_download))
die('there is no file');
header('Content-type: octet/stream');
header('Content-disposition: attachment; filename="'.$arquivo.'";');
header('Content-Length: '.filesize($caminho_download));
readfile($arquivo);
?>
когда я проверил браузер в сети, он возвратил это в предварительном просмотре: PGJyIC8 + Cjxi
и это в шапке:
Задача ещё не решена.
Других решений пока нет …