How to make it possible to download a document from the site?
Closed due to the fact that the essence of the question is incomprehensible by the participants PashaPash ♦ , Vladimir Glinskikh , aleksandr barakin , Kromster , Abyx 8 Aug '15 at 11:15 .
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
- Link to document .. :) - Rules
|
2 answers
Like this:
<a href="document.doc">Скачать</a>
|
$path='where/';$file='what'; header("Content-Disposition: inline; filename=\"$file\""); //указываем имя файла header("Content-Type: application/octet-stream");// указываем MIME - тип header("Content-Length: " . filesize($path.$file)); //указываем размер readfile($path.$file);//выдаем файл
|