determining mime type
[email protected] ("Dang Nguyen") Fri, 13 Jun 2003 15:47:34 -0700
| Newsgroups | php.lang |
|---|---|
| Message-ID | <[email protected]> |
Hi All, I have files in a directory that I need to display as a directory listing onto a web page. Users can click on the document and open the contents in their browser. I also have the files stored in an area not directly accessible by the web server, for security purposes. The script that retrieves it gets the path and mime type from a mysql database before opening and outputting the file's contents to the user's browser. The mysql database gets its information from another php script that is used to upload and store the files. When the files are stored, I can find out what mime type it is and store it in the database. Now, the users have a need to batch process a bunch of files (~50 files). I've recommended that these batches of files be copied to the webserver by ftp or some other means, and the users are fine with that. However, the problem arises: how does the script used to open the files and sends the contents to the user's browser know what mime type it's sending? What happens if I don't specify any mime type in the header? Will it be displayed in the user's browser as if I had anyway? -- Dang Nguyen