March 7, 2013

Force Download File with php finfo

PHP: Hypertext Preprocessor

Force Download File with php finfo $file_info = new finfo(FILEINFO_MIME); $type = $file_info->buffer(file_get_contents($zip_file)); header(“Pragma: public”); header(“Expires: 0”); header(“Pragma: no-cache”); header(“Charset: null”); header(“Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0”); header(“Content-Type: application/force-download”); header(“Content-Type: application/octet-stream”); header(“Content-Type: application/download”); header(‘Content-disposition: attachment; filename=’ . str_replace(‘ ‘,’-‘, file_parts($zip_file,’name’))); header(“Content-Type: $type”); header(“Content-Transfer-Encoding: binary”); header(‘Content-Length: ‘ . filesize($zip_file)); @readfile($zip_file); exit(0); Its a revision to Download […]

February 26, 2013

WordPress Function – Load Serialized Array from a Binary File

wordpress

WordPress Function – Load Serialized Array from a Binary File This function give you the convenience of reading serialized array from a binary file. It is good to manage few things with files instead of querying the database for very small flags which can be intelligently manged through filing. if(!function_exists(‘load_binary_file’)) { function load_binary_file($settings=array()) { $binary_file_file […]

March 25, 2012

internet explorer cannot download 704 from site

internet explorer cannot download 704 from site This problem will mostly occur when you will test your script in old version(s) of IE. This article is continuity of previous article Download file problem due to version incompatibility of IE & Adobe Reader. In fact when i posted the previous problem with corrections so that was […]

March 15, 2012

Download file problem due to version incompatibility of IE & Adobe Reader

Download file problem due to version incompatibility of IE & Adobe Reader I have reviewed & updated the code. In fact when we throw the file content in page, it has two options a) Will open PDF in the browser b) Will start download immediately Before correction in PHP script, you need to check the […]

January 30, 2012

DAFT (disk geometry-aware file system traversal)

DAFT (disk geometry-aware file system traversal) is an optimization available for modern file system. It fetches the files into memory according to the disk geometry. It is implemented and tested with commercial AV scanners and data backup agents. It is observed that it can reduce the elapsed time by a factor of 5 to 15 […]