Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If I view a TXT file on my shared host it has a content-length. I need the server to generate a TXT file from a GET request. I have changed the mime type to treat .txt as .php files. When I try and view the file the transfer-encoding is used. From what I gather this is because apache does not know the file length. I can work out the file length, no problem but how to tell apache to prevent this encoding?

share|improve this question
Why would you need to do this? –  Shane Madden Sep 12 '11 at 14:45
I have a M2M project the reads files from a webserver. It expects a .txt file. I want to dynamically create these files so I don't have to write files to the server. The solution was to use header("Content-Length:".$length); –  maxum Sep 13 '11 at 1:43
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.