Skip to content

PHP

HTTP 404 response causes forced downloads to fail

An interesting gotcha that I stumbled across recently, sending a 404 response code with a download forced by Content-Disposition: attachment will fail but inline content will still be displayed. This behaviour was tested in both Chrome and FireFox. Of course the appropriate response code should always be sent; this 404 response code was being sneaked in by WordPress and led to hours of frustration.

A reason why Larry Ullman is awesome

So, if you’re interested in developing with PHP, you should really check out the Yii Framework. And if you like what you see, I strongly recommend Larry Ullman’s Yii Book. While still in the making, you can buy it now and receive the updates as Larry writes and revises the chapters.