AV1611 Posted February 8, 2008 Share Posted February 8, 2008 What would the header content-type be for a .txt file? i.e. for an ms word its: content-type: application/vnd.ms-word or whatever. I just wanna push out a plain txt file Quote Link to comment https://forums.phpfreaks.com/topic/90083-contect-type-for-txt-file/ Share on other sites More sharing options...
cooldude832 Posted February 8, 2008 Share Posted February 8, 2008 well pushing a word doc isn't at text doc now is it i'd say go with <?php header("content-type: text/txt"); ?> Should be good http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html that is helpful also Quote Link to comment https://forums.phpfreaks.com/topic/90083-contect-type-for-txt-file/#findComment-461868 Share on other sites More sharing options...
AV1611 Posted February 8, 2008 Author Share Posted February 8, 2008 Sigh... I've wasted too much time. I admit it. I can't figure this out. I have a simple project. I want to fill out a webform and when you click submit, it pushes a dynamic file to the user for download. I almost have it working... but... If I use content-type: application/msword doc then if you use OO.O (as I do) it works great, but in M$ Word, it asks user to convert format. NO GOOD. If you use content-type: plain/txt then it is a mime type and the browser just displays the file. How can I make the submit either a txt or doc file ( I really don't wanna make a pdf but that's really what it should be ) that simply downloads? Is there a way to make the headers download rather than display as a mime type file? Quote Link to comment https://forums.phpfreaks.com/topic/90083-contect-type-for-txt-file/#findComment-461871 Share on other sites More sharing options...
cooldude832 Posted February 8, 2008 Share Posted February 8, 2008 yeah look on that w3 page there is a header to force downlaod I think its attachment is what it is called FYI don't send word if you don't want to make a pdf (lazy) then make a rich text file or text file. Quote Link to comment https://forums.phpfreaks.com/topic/90083-contect-type-for-txt-file/#findComment-461874 Share on other sites More sharing options...
AV1611 Posted February 8, 2008 Author Share Posted February 8, 2008 I really need to find a solution for php/pdf. I just haven't spent the time to research it. I settled on RTF. It seems to behave in M$ and Linux ok and give some formatting that .txt doesn't. (It doesn't do pictures at all does it?) Does anyone see any issues with using RTF? It's not gonna deprecate any time soon I don't think. This is a good link of how to format RFT http://www.biblioscape.com/rtf15_spec.htm Quote Link to comment https://forums.phpfreaks.com/topic/90083-contect-type-for-txt-file/#findComment-462015 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.