My php code is
// Type MIME
$type = "application/pdf";
$visibleName = "fighter.pdf";
$completePath = "http://www.webweb.infinityfreeapp.com/lichi/fighter.pdf";
// Force download
header("Content-disposition: attachment; filename=$visibleName");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public");
why this file return a html file instead of pdf content data
<html><body><script>document.cookie="_test=3615ff5e48bd398a38d2ce932bef0629 ; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/" ;document.location.href="http://www.webweb.infinityfreeapp.com/lichi/download.php?path=fighter.pdf&i=1";</script></body></html>
Plz help me
I believe this is the answer to your question.
Not only pdf file for all type of download file either image
Could you provide a link for me to test it? I’m not sure why you decided to use PHP to download the file but I’ll go with it.
Sir i just comment this header work fine
Thank you for quick response but why sir Content-Length header return error
A. You used it incorrectly
B. Ours system is somehow preventing it from working right’
If it works, leave it, and don’t question it.
wonderful - visit this link
more details regarding the link above
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.