Jump to content

headers questions


holowugz

Recommended Posts

[code]$ name = $_GET['File'];
$ size = f ilesize($name);
$ type = m ime_content_type($name);
$ content = f ile_get_contents($name);

h eader("C ontent-length: $ size");
h eader("C ontent-type: $ type");
h eader("C ontent-Disposition: attachment; f ilename=$name");
echo $ content;[/code]

Remove the spaces in the function names and such.
Not necessarily...you can put it where ever you want, you just need to either pass the location as a part of the variable, or if they are all in a different sub directory, you can code it that way. Or you can store file names and locations in an array, then pass the array key as the var...kind of like an id.

It doesn't have to be in the same directory.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.