|
|||||||
![]() |
Forum Index > glFusion > glFusion Support |
|
|
PDF's opening in browser as opposed to File Open/Save As dialog
|
|||
| | | Printable Version |
|
dlassen | ||||||||
|
Hi guys, http:\\localhost\test.pdf in a browser, the pdf opens in-line, but I was hoping to conceal the name and location of the file - something that is well outside of my php/html capabilities. |
![]() Junior Group Comfort Level:: 0 ![]()
Registered: 10/29/09 |
||||||||
|
|||||||||
|
lgarner | ||||||||
|
I think if you store them in the File Manager instead of Media Gallery it'll work as you want. Media Gallery stores its file under the public directory while File Manager can be configured to store them outside of the web root. |
![]() Admin Group Comfort Level:: +51 ![]() ![]()
Registered: 06/10/08 |
||||||||
|
|||||||||
|
mst3kroqs | ||||||||
|
Lots of ways to do this, although if you're asking glFusion itself to download PDF rendering code to the browser itself in order to display PDF in a glFusion-controlled content window, while that is possible, it's probably not practical. PHP Formatted Code global $_CONF;// these iframe values can be overridden with page _REQUEST variables that are passed $fb = 0; // frameborder - if set to 1, draws a broder around the iframe $w = '100%'; // width - if set as percentage, auto-scales to available width, else you can set a fixed falue in pixels $h = '800'; // height - in pixels $mh = 0; // marginheight $mw = 0; // marginwidth $s = 'auto'; // scrolling frame? $fp = '/files'; // base path to pdf's // get the (sanitized) page parameters foreach ($_REQUEST as $arg => $value) $$arg = COM_applyFilter($value); // we're looking for a $pdf filespec if (empty($pdf)) { $html = 'No PDF file was specified.'; return $html; } // make a url using the site url and basepath specified by $fp $pdfurl = $_CONF['site_url'] . $fp . "/" . $pdf; // display the pdf in the iframe $html = '<iframe src="' . $pdfurl . '" frameborder="' . $b . '" width="' . $w . '" height="'. $h . '" scrolling="' . $s . '" marginheight="' . $mh . '" marginwidth="' . $mw . '"></iframe>'; return $html;
PHP Formatted Code You can [pdf-link:file-to-display.pdf click here] to view the PDF.
Mark A. Howard |
![]() Admin Group Comfort Level:: +15 ![]()
Registered: 07/18/07 |
||||||||
|
|||||||||
|
mst3kroqs | ||||||||
|
I should add/clarify - this is not a solution for Media Gallery, but it is a general-purpose solution for the site. Mark A. Howard |
![]() Admin Group Comfort Level:: +15 ![]()
Registered: 07/18/07 |
||||||||
|
|||||||||
|
dlassen | ||||||||
|
Thanks Mark - before I start exploring your suggestions, I have one question regarding this remark: I should add/clarify - this is not a solution for Media Gallery, but it is a general-purpose solution for the site.
|
![]() Junior Group Comfort Level:: 0 ![]()
Registered: 10/29/09 |
||||||||
|
|||||||||
|
mst3kroqs | ||||||||
|
Unfortunately, this will not help you if you are storing the PDF's in MediaGallery. Mark A. Howard |
![]() Admin Group Comfort Level:: +15 ![]()
Registered: 07/18/07 |
||||||||
|
|||||||||
|
| All times are CDT. The time is now 05:58 pm. |
|
|