GarrysMod is not accepting my PHP referred fastdl files.
2 replies, posted
Hi.
I hope its ok if i put real ips in here.
I was getting tired of manually doing fastdl, so i have modified this script. In theory this should work, right? (i'm aware of the the security risks involved)
I have setted it up, so the fastdl on the server points to:
https://techsource.dk/fastdl/ttt - Ik this is a 404 site, but let me explain
So, the client is told to download:
materials/vgui/ttt/icon_footvision.vtf
and i would assume it is trying to download from this link:
https://techsource.dk/fastdl/ttt/materials/vgui/ttt/icon_footvision.vtf.bz2
And if you try clicking on that link, it download the file no problem!
BUT
in garrysmod i get the following error:
HTTP ERROR 8 downloading https://techsource.dk/fastdl/ttt/materials/vgui/ttt/icon_footvision.vtf
It is not even trying to get the bz2 file it looks like?
Why is that? When im joining the server, i see "Downloading materials/vgui/ttt/icon_footvision.vtf.bz2" but in the console, all i see are NON-bz2 files?
Is garrys mod some how detecting something about my script, since it does not want to download it?
Try wiithout HTTPs
Well. I have spent hours working on this issue, and then i post here, and figure a solution out..
Garrysmod apparently have a pretty big deal with how the http headers are set up.
This worked for me:
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header("Content-Disposition: attachment; filename=\"" . basename($file) . "\";");
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
Sorry, you need to Log In to post a reply to this thread.