Posted 18 March 2006 - 02:19 PM
for example when someone goes to my page:@
i want them to download cheese.zip or what ever, i am told you can do that with headers but how?
Posted 18 March 2006 - 03:31 PM
$ 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;
Remove the spaces in the function names and such.
Posted 18 March 2006 - 09:56 PM
Posted 18 March 2006 - 10:07 PM
It doesn't have to be in the same directory.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users