I play with exporting dynamic data from a database to a browser. I see that there are different types of content, and some of them I need to ask. I have to ask the wrong questions since I do not find detailed information in search engines.
Here are a few of the ones I've seen from personal scenarios of people.
header("Content-type: application/zip;");
header("Content-type: application/csv");
header("Content-type: application/x-msdownload");
header('Content-Type: application/vnd.ms-excel');
header('Content-type: application/octet-stream');
I can clearly understand "zip", "csv". But others leave me questions. For example, when do I use them?
I tried x-msdownload for xls files and it seems to work. But I see others using vnd.ms-excel. What for? Should I use this? I also see the octet stream used to load the csv file created by php. Why?
In any case, I do not find much on php.net. Not to say that this is not, but clear descriptions are not shown.
Does anyone know a site that breaks down different types of content and why are they used?
source
share