...

View Full Version : what is exactly mime type for .PHP file?



frozenade
11-28-2007, 12:46 PM
i found many ways to force download in PHP by googling.
but i difficult to force download PHP file. I've searched mime type for php but nothing, just asp (text/asp).

what is mime type for php file so i can force download .php file?

thank you.

arnyinc
11-28-2007, 01:13 PM
Are you trying to offer a php file for your users to download? Or are you trying to force a download of some media file?

Typically you are trying to force a download of a zip file or a movie file and you need the mime type of those files. You don't need the mime type of the php file unless you are offering php files to download.

croatiankid
11-28-2007, 02:00 PM
If I remember correctly, the application/octet-stream MIME type will give a download prompt in all browsers.

frozenade
11-28-2007, 02:25 PM
Are you trying to offer a php file for your users to download? Or are you trying to force a download of some media file?

Typically you are trying to force a download of a zip file or a movie file and you need the mime type of those files. You don't need the mime type of the php file unless you are offering php files to download.

I offer php file to be downloaded. How could I do this?


If I remember correctly, the application/octet-stream MIME type will give a download prompt in all browsers.

i found that application/octet-stream is used by EXE file. can it used to php file too?

CFMaBiSmAd
11-28-2007, 02:29 PM
Trying things is a great way of learning what works and what doesn't and it is often the quickest way to get an answer.

frozenade
11-28-2007, 02:45 PM
ok, i'll try it. thank you. :D

Apostropartheid
11-28-2007, 04:15 PM
The PHP MIME type is application/x-httpd-php, if anyone's actually interested.

felgall
11-28-2007, 08:50 PM
It isn't supposed to be the MIME type that defines whether something displays in the browser or is offered for download. The only time that is supposed to have an impact is where the browser is not able to handle the MIME type specified.

To specify that a file is supposed to be offered for download you are supposed to use:

Content-Disposition: attachment;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum