customising a download box

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

customising a download box

Post by hame22 »

Hi all

I have produced a page that starts a download of a PDF. However when the download box opens it has the option of opening the file.
What i want to do is force the user into saving onto their computer so i really would like to remove the "open" button.

Is this possible?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

look at header() you should.

pdfs, are their own beasts though, certain you can force them to d/l a pdf I am not.

Code: Select all

header("Content-Description: File Transfer");
header("Content-Type: application/pdf");
header("Content-Disposition: attachment; filename=".$filename_string);
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

Post by hame22 »

yeah i have something similar;

Code: Select all

header (&quote;Content-Type: application/octet-stream&quote;);
header (&quote;Content-Type: application/download&quote;);
header(&quote;Content-Disposition: attachment; filename=$file&quote;);
header(&quote;Content-Length: $size&quote;);
bt is it possiible to customise the download box so there is just a save button?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

referring to customizing the firefox or IE dialogue box are you?

If you are, possible to do that it is not...
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

Post by hame22 »

either but both preferably!!
Post Reply