I am writing a Unit Test for a class and need to generate a few files with different mime-types.
I know how to set the mime-type when sending a file to a remote user (ala header()
), but how to do it when using fwrite()
on the local server?
For a file generated in this method is the mime-type derived directly from the file extension?
I'm using PHP 5.3.x on Ubuntu 12.04