Fix: Surface Pro 3 is not going to deep sleep in Windows 10

By default Surface Pro 3 will go into deep sleep (hibernate) mode once you don’t use it for around 4 hours. which is basically a good feature. it helps a lot with the battery. Recently I realized that my surface pro 3 which is running latest version of windows 10 is not going to that state… Continue reading Fix: Surface Pro 3 is not going to deep sleep in Windows 10

Detect MIME type and buffer it to browser using PHP

The following piece of code handles detection of mime type, file size and existence of the file for you. I always use this piece for buffering files into browser of my users. if (file_exists($fileLocation)) { header(‘Content-Description: File Transfer’); header(‘Content-Type: ‘ .mime_content_type($fileLocation)); header(‘Content-Disposition: attachment; filename=”‘.basename($fileLocation).'”‘); header(‘Expires: 0’); header(‘Cache-Control: must-revalidate’); header(‘Pragma: public’); header(‘Content-Length: ‘ . filesize($fileLocation)); readfile($fileLocation);… Continue reading Detect MIME type and buffer it to browser using PHP