file download....

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 39
Joined: Tue Aug 06, 2002 8:58 am
Location: UK

file download....

Postby cho@ » Mon Sep 08, 2003 1:56 am


I have written a small script allowing users to download a file by simply click on the link....

The link looks like that:

Code: Select all

echo "file: <a href=\"download.php?doc=$file\" class=maintext>$file</a><br>";

And here the code in my download.php file

Code: Select all

$file= $HTTP_GET_VARS['doc'];

  header("Content-Type: application/download\n");
  header("Content-Disposition: attachment; filename=\"$file\"");
  $fn=fopen("$file" , "r");


You r gonna tell me where is the prob if everything woks???
The stuff is that once the file is download IE keep loading a page.. "this little annoying sand thingy"
How can I stop that...???


ps:sorry I knw it might not be revelant to php

How can

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Mon Sep 08, 2003 12:15 pm

can you make header location to file? or you dont wont this?

php-forum Active User
php-forum Active User
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Postby sigix » Mon Sep 08, 2003 8:39 pm

or you make the zip file of that file and give path
will give user download dialog...
or use the above said method

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 4 guests