Posts

Showing posts from August 31, 2008

Inline-download problem with IE browsers

IE's problem again faces some criticism to my part. I came up of this snippet that does an inline download of a file. Adding of header("Cache-Control: maxage=1"); //In seconds header("Pragma: public"); heals the problem when a file is in buffer at the client's browser. Problem occurs here is when a user attempts to open a file, it does tells that the file sort of not found or whatever Microsoft tells. " filename = unique_string(8); $fp = fopen("/tmp/{$filename}", 'w'); fwrite($fp, $contents); fclose($fp); header("Cache-Control: maxage=1"); //In seconds header("Pragma: public"); header( 'Content-Type: ' . 'application/pdf' ); header( 'Content-Disposition: inline; filename="' . basename("/tmp/{$filename}") . '.pdf' . '"'); // Add the rest of the headers header( 'Cache-Control: public' ); header( 'Co...

Detecting plugins for pdf

I just found this site that can detect acrobat reader in browser plugins. Here's the link: http://gemal.dk/browserspy/acrobat.html Viewing the source code of that page, i found these lines in the script which does the detection of pdf plugin. <object id="ocx_pdf" classid="clsid:{CA8A9780-280D-11CF-A24D-444553540000}" style="display:none"></object> <script type="text/javascript"><!-- var i_acrobatreader; var v_acrobatreader; var a_acrobatreader; if (obj(navigator.plugins)) { for (var i=0; i < navigator.plugins.length; i++) { if (navigator.plugins[i].name.toLowerCase().indexOf("adobe acrobat") >= 0) { i_acrobatreader = true; v_acrobatreader = navigator.plugins[i].description.substring(navigator.plugins[i].description.toLowerCase().lastIndexOf("version ") + 8, navigator.plugins[i].description.toLowerCase().lastIndexOf(" for")); break; } } } // --></script> <script type="te...

CSS Hide Background

I just found this css snippet to somewhat like disabling the elements behind if a dialog box appears. /* Enables to disable elements behind */ .somethingDialogUnderlayWrapper { position: absolute; left: 0px; top: 0px; z-index: 998; display: none; background: transparent; } /* colors to a disabled-color */ .somethingDialogUnderlay { background: #eeeeee; opacity: 0.5; }