download the file

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
User avatar
rajan
Forum Contributor
Posts: 110
Joined: Sun Aug 28, 2005 7:42 pm
Location: Lucknow, UP, India

download the file

Post by rajan »

when i download the adobe acrobat reader file using
header('Content-type: application/pdf');
it is working good for pdf

but in case of exe it's not working good and give unknown file type when i use the header
header('Content-type: application/exe');
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

try application/octet-stream

or one of the others from here:

http://www.filext.com/detaillist.php?ex ... rch=Search
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Are you trying to force a download - so that no matter what the file is the user downloads it? If so, do a search for 'force download' and you'll find what you need.

If you're just concerned with an exe file, the mime type you want is: application/octet-stream
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
rajan
Forum Contributor
Posts: 110
Joined: Sun Aug 28, 2005 7:42 pm
Location: Lucknow, UP, India

Post by rajan »

thank you Burrito for very usefull link
Post Reply