Forum Discussion

BerryZondag's avatar
BerryZondag
Qrew Trainee
11 years ago

How to display PDF in file attachment fields

File attachment fields can show the attached files in forms and reports, but only a few file types are accepted (jpeg and such). Is there a way around this so that PDF attachments can be shown either directly in the form, or as a pop up window (I believe that is called an Iframe ?) after clicking on some button for that purpose?

I now have that sort of working through a Chrome extension, which opens the PDF in another tab, but it's slow and cumbersome and has some unwanted side effects.

62 Replies

  • Try this as a formula Rich text field type  but 

    I have a few different formuals on file, try this one.  Replace the 6 with the fid holding the file attachment.  Play with the width to get the size you want.  You can also instead specify the height, but I suggest not specifying both as the image will get skewed.

    "<img src=" & URLRoot() & "up/" & Dbid () & "/a/r"   & [Record ID#] & "/e6/v0' width='300' >"
  • Thanks for the new formula but it does not work for PDFs which is why I was trying to use the google viewer as Ryan suggested.
  • Hi guys,

    I�m currently evaluating whether to use Quick Base to deliver a business solution and the ability to view PDFs is a must-have feature.

    I managed to get the file attachment to view if it is an jpg with a rich text field containing:

     "<img max-width=\"32px\" max-height=\"100px\" src=\"" & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e46/v0\" />"

     

    And these variables :       

    /iol               &rand='+new Date().getTime())};">

    iol           <img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=



    However, when I attached a PDF and use a second text field with

    var text URL = "https://docs.google.com/gview?url="; & URLRoot() & "up/" & Dbid () & "/a/r" & [Record ID#] & "/e46/v0&embedded=true";

    "<embed src=\"" & $URL & "\" height=\"650\" width=\"900\">"

    It just renders to this on the page!!!

    <embed src="https://docs.google.com/gview?url=https://msip.quickbase.com/up/bnfd9ydpg/a/r5/e46/v0&embedded=t...; height="650" width="900">

     

    Also, if I copy this url into a browser it just renders HTML.

     

    Can anyone help?

     

    • ChadBrandmire's avatar
      ChadBrandmire
      Qrew Assistant Captain
      Are the file attachment field properties set to allow open access?
    • ChadBrandmire's avatar
      ChadBrandmire
      Qrew Assistant Captain
      The problem you're having is that this solution relies on using google docs, which is why you need to allow access outside of quickbase. 
      If you can find a way to use a document viewer internally with your app that would solve your privacy problem. Unfortunately outside of finding a third party app I don't know of a way to do that
      If you figure out a way, please share  
  • I would like QuickBase to be able to display embedded PDFs from my network. I do not know if this is possible.

    Side note: Formula - URL field can open files into Chrome, e.g.: "C:\\\\Users\\wesmc\\Desktop\\"&"Empower.pdf"

    Using the Magic Buttons app, I have a PDF (file attachment) displaying embedded in a form. I am trying to take it a step further by displaying a file from a hyperlink (to the file on my local network).

    Left: Attachment; Right: Hyperlink



    I am not sure if this is possible since the file is not actually in QuickBase. The error in the iframe looks like what you get when trying to display the PDF without checking the box "Allow open access" in the Field Properties for the file attachment.

    This makes me wonder if there might be a way around this.

    Any ideas about whether this is feasible would be appreciated.

    Thanks!
    • RyanPflederer2's avatar
      RyanPflederer2
      Qrew Trainee
      Haven't tested it, but my initial thought is that the field is not publicly available. So in order to do that you'd need to have a role for 'Everyone on the Internet', with view access of that field.
      As a caveat though, if you're linking to a local resource only those with access to the resource will see the file.
    • WesMcAda1's avatar
      WesMcAda1
      Qrew Member
      Thanks for the response. I just tried EOTI, but I did not make any progress that I can see. Also, thanks for addressing the limitation of access.
    • WesMcAda1's avatar
      WesMcAda1
      Qrew Member
      Another thought I had is if it would be possible to use a rich text field to display a button that - when clicked - actually attaches a file to a record (from the established location), redirect/refresh to the record, and then display.

      Basically, this would be a step between my URL field to the PDF on my network and the file attachment field that is displaying as needed.
      • ZachShumate's avatar
        ZachShumate
        Qrew Trainee
        Does anyone have the final solution here to get this to work? I was not able to find this in the magic buttons application and cannot get the formulas listed to work either.

        ------------------------------
        Zach Shumate
        ------------------------------