File preview
From FileRun Documentation
Documents can be previewed using internal viewers or external online services. The internal viewers are available for the following file types: JPG, GIF, PNG, ZIP, FLV, MOV, MP3, SWF, TXT and URL (links to websites). If ImageMagick is installed you can also get thumbnails and preview for files like PDF, PSD, EPS, TIF, etc.
Support for the following online services is included:
Google Docs Viewer (http://docs.google.com/viewer)
- available for: "pdf", "tif", "tiff", "ppt", "doc", "docx"
- no configuration or API key required
Scribd iPaper Viewer (http://www.scribd.com/ipaper)
- available for: "pdf, ps, doc, docx, ppt, pps, pptx, xls, xlsx, odt, sxi, ods, sxc, txt, rtf, tif, tiff"
- sign up here for an API account: http://www.scribd.com/developers/signup_api
- the API key, API secret and publisher ID need to be configured inside the file "/path-to-filerun/customizables/custom_actions/scribd_ipaper/app.php"
Zoho Viewer/Sheet/Writer (http://www.zoho.com/)
- "Writer" available for: "doc", "docx", "html", "sxw", "rtf", "txt", "odt"
- "Sheet" available for: "xls", "xlsx", "sxc", "csv", "ods", "tsv"
- "Viewer" available for: "pps", "ppt", "pdf", "odp", "sxi"
- singup here for an API key: http://writer.zoho.com/apikey.htm
- the API key needs to be configured inside the file "/path-to-filerun/customizables/custom_actions/zoho/app.php" and "/path-to-filerun/customizables/custom_actions/zoho_view/app.php"
Vuzit Viewer (http://vuzit.com/)
- will no longer be included by default in the FileRun installation
- note that this is not a free service
- available for: "pdf, doc, docx, rtf, xls, xlsx, ppt, pptx, eps, ras, odt, odf, ott, odg, odp, stw, sxw, std, sxd, sti, sxi, sxc, sda, sdd, sdw, vor, otg, stp, ods, pts, tif, bmp, ppm, xpm".
- you need to signup for an API key and configure it inside "/path-to-filerun/customizables/custom_actions/vuzit/app.php"
Snipshot Image Editor (http://snipshot.com/)
- available for: "jpg", "gif", "png", "tif"
- no configuration or API key required
Autodesk Freewheel Viewer (http://labs.autodesk.com/technologies/freewheel/)
- available for "dwf" documents
- no configuration or API key required
Hiding Preview Options
You can remove/disable any of the preview options be renaming their folders inside "/path-to-filerun/customizables/custom_actions/" and adding an underscore in front of their names. For example, to hide the contextual menu option "View it with iPaper", simple rename the folder "/path-to-filerun/customizables/custom_actions/scribd_ipaper" to "_scribd_ipaper".
Setting Default Method
If you want to preview certain file types automatically with an online service, you can follow these steps:
- Create a new folder inside "/path-to-filerun/customizables/viewers/" named as the extension of the files you want to preview. If you want to preview Microsoft Excel Spreadsheets, for example, you should name the folder "xls".
- Create a text file named "index.php" inside the newly created folder, and copy the following text inside:
<?php $customAction = "scribd_ipaper"; global $str, $config; $url = $config['url']['root']."/?module=custom_actions&action=".$customAction; $url .= "&path=".$str->forURL($str->fromHTML($_REQUEST['path'])); $url .= "&filename=".$str->forURL($data['fileName']); header("Location: ".$url); ?>
- This will make "Scribd iPaper" the default preview action for the "xls" files. If you wish to use Zoho Viewer instead, you should replace "scribd_ipaper" with "zoho_view", in the above code.
