Posts

Showing posts from 2013

How to force PDF/Image to download in PHP website?

I have used the below code in reference to php.net, Please try the below code it works. function downloadFile ( $fullPath ){   // Must be fresh start   if( headers_sent () )     die( 'Headers Sent' );   // Required for some browsers   if( ini_get ( 'zlib.output_compression' ))     ini_set ( 'zlib.output_compression' , 'Off' );   // File Exists?   if( file_exists ( $fullPath ) ){         // Parse Info / Get Extension     $fsize = filesize ( $fullPath );     $path_parts = pathinfo ( $fullPath );     $ext = strtolower ( $path_parts [ "extension" ]);         // Determine Content Type     switch ( $ext ) {       case "pdf" : $ctype = "application/pdf" ; break;       case "exe" : $ctype = "application/octet-stream" ; break;     ...

How to import device width based CSS file?

To specifically call a stylesheet you need to use the link tag in your HTML, see the below  Try the below  <link rel = "stylesheet" type = "text/css" media = "screen and (min-width: 701px) and (max-width: 900px)" href = " css/medium.css" / >                                                           (OR) <link rel = "stylesheet" type = "text/css" media = "only screen and (max-device-width: 780px)" href = "max-device-width-780px.css" / >