Posts Tagged ‘HTTP’

[PHP] Force download the files

Some time you may want the user download the file instead of direct open in the browser.
(e.g. The PDF reader add-on will be directly open the PDF in the browser)

You just need modify the http headers and set the content type to force-download, the problem will be solved.

The following is the demo and the source code:

Read the rest of this entry »

 

Popular HTTP response status code in the web development

The popular HTTP response code with simple description:

2xx Success

200 OK

Good status, server return successful

3xx Redirection

301 Moved Permanently

Permanently redirect to new URL, better in the SEO (Recommend)

302 Found

Temporary redirect to new URL(Default)

304 Not Modified

The request resource has not been modified since last requested. Browser will load the content from cached (IE may not)

Read the rest of this entry »