How can I set an XLIFF mimetype on a file produced by DOMDocument?



I'm attempting to produce XLIFF files via DOMDocument. The process is basically this:



  1. Generate and save markup

  2. Repeat step 1 for multiple files

  3. Compress files to ZIP and serve to user


I've been using DOMDocument::saveXML() to save the files but when saving them with the extnesion XLF the files' MIME type becomes application/octet-stream (ideally it needs to be application/xliff+xml). The upload process we're using relies on MIME checking for whitelisting and I'm sure as heck not whitelisting octet streams.


That said, what are my options? Is there some equivalent to header(content-type: xyx) that I can employ along with the DOMDocument utility?


No comments:

Post a Comment