Skip to content

fix for pdf preview error without degrading security

The preview is broken if you have your storage directory secured, the fix is in file: /public_html/layouts/v7/modules/Documents/FilePreview.tpl

change line 54 which was:

                       {else if $PDF_FILE_TYPE eq 'yes'}
                            <iframe id='viewer' src="libraries/jquery/pdfjs/web/viewer.html?file={$SITE_URL}/{$FILE_PATH}" height="100%" width="100%"></iframe>

to

 {else if $PDF_FILE_TYPE eq 'yes'}
  <iframe id='viewer' src="libraries/jquery/pdfjs/web/viewer.html?file={$SITE_URL}/{$DOWNLOAD_URL|escape:'url'}" height="100%" width="100%"></iframe>