|
Тема |
Re: download na file [re: rdx1271] |
|
Автор |
$burov (начинаещ) |
|
Публикувано | 22.02.05 08:57 |
|
|
header("Content-type: $type");
header("Content-Disposition: attachment; filename=$name");
readfile($path_to_file);
или пък с малко повече хедъри:
$size = filesize($path_to_file);
header("Content-type: $type");
header("Content-Length: $size");
header("Content-Transfer-Encoding: binary");
header("Content-Disposition: attachment; filename=\"$new_file_name\"");
header("Expires: 0");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
readfile($path_to_file);
|
| |
|
|
|