Hack Forums
[PHP] PHP Downloader Script - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] PHP Downloader Script (/showthread.php?tid=5376824)



PHP Downloader Script - Qismon - Aug 16, 2016

Hello if anyone could help out with this it would be great.

Just looking for a basic PHP Script that will download from specified URL and execute the file.

PM me if you are able to do this or just post it here to help out the community! Thanks!


* - Αlpha - Aug 16, 2016

You can save files as a blob in a db for example, you can fetch the blob from the db and simply spit it out on the page.

Code
header("Content-Type: application/exe");
header("Content-Disposition: attachment; filename=foo.exe");
header("Content-Length: $size");

If the content type varies, make sure to also store the content type in the db.