user1032531
user1032531

Reputation: 26331

Should content-transfer-encoding headers be use when downloading files via HTTP?

I recently came across How to force file download with PHP which describes setting Content-Transfer-Encoding. Is this header applicable when used with this application when used to download a file via HTTP (it appears to be email related)? If so, what should it be set as for MS Word and Excel files, ZIP files, PDFs, and Text?

header("Content-Transfer-Encoding: Binary"); 

Upvotes: 0

Views: 3686

Answers (1)

CodeCaster
CodeCaster

Reputation: 151720

It has been religiously included by carg-cult copy-paste programmers since it was mentioned in a comment to the readfile() manpage on PHP.net.

It indeed has little to do with HTTP and you can safely remove it.

Upvotes: 5

Related Questions