Hey,

ik heb een basis download scriptje geïntegreerd in mijn site om pdf files te downloaden. Zolang de pdf's op dezelfde host staan als mijn script is er geen probleem, alles werkt. Maar vanaf ik verwijs naar pdf's op een andere host, dan wil hij mijn downloadscript downloaden :s . Ziehier de code:

header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
header("Content-disposition: attachment; filename=\"".basename($file)."\"");
readfile($file);
exit();

Dus als de $file variabele verwijst naar file binnen de host (bv. /folder/bestand.pdf) . Maar verwijs ik naar (bv. http://host.com/folder/bestand.pdf) dan doet hij het niet meer.

Iemand raad?

Alvast bedankt
http://nl.php.net/readfile
Tip: You can use a URL as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename and Appendix L for a list of supported URL protocols.
Tip: You can use a URL as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename and Appendix L for a list of supported URL protocols.

Dit is dus bij jou dus niet

Reageren