Page 1 of 1

Download links to files

Posted: Thu Jan 17, 2008 8:13 am
by LonelyProgrammer
Hi,

I am currently hosting binary format of a game save files on my server. The strange thing is, I have to give Execute right to Public, User and Owner for upload folder before others can download it. How can I serve the file to them from the upload folder without having to directly link to the upload folder?

Re: Download links to files

Posted: Thu Jan 17, 2008 11:27 am
by aceconcepts
How about using an include and then within the include use an id to fetch the corresponding file from a database.

Re: Download links to files

Posted: Thu Jan 17, 2008 11:31 am
by Jonah Bron
I believe you can make a php page that will 'return' the document, as it were.

Something around this type of thing, but I'm sure this right here doesn't work. I've never done it before:

Code: Select all

<?php
$file = file_get_contents('the file address');
header('Content-type', 'the type of the file');
echo $file;
?>