August 6, 2012 5:06 am

Force to download a file in PHP

In this tutorial we have simple script to download files by force instead of open it in browser window. This is useful for common file types that would normally be displayed in a browser .csv, .php and all types of images( gif, png, jpg etc. ).

PHP Code

Simple PHP function function.php

Simple PHP file index.php

Author Huzoor Bux

I am Huzoor Bux from Karachi (Pakistan). I have been working as a PHP Developer from last 5+ years, and its my passion to learn new things and implement them as a practice. Basically I am a PHP developer but now days exploring more in HTML5, CSS and jQuery libraries.


Tutorial Categories:
  • Mohd Farhan Rizwan

    Asslamoalaikum Thank you so much Hazrat Huzoor Bux sahab i really appreciate. Thank you once again..:)