Discussions

Expand all | Collapse all

URL Button to Preview File

  • 1.  URL Button to Preview File

    Posted 11 days ago
    I have a file attachment and I'm looking to make a button for the user to preview the file attachment. I found an old thread about this suggesting the following, however when I click that I get a url cannot be found web page. Also, it opens in the same tab as quickbase, and I am hoping to open in a new tab. Can anyone help? Thanks!

    if ([Document]>"", "<a href=\"" &URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#]& "/e999\"target=_blank\">" & [Document]& "</a>","")



    change the 999 in e999 to be the field id of the Document field



    ------------------------------
    Mike Tamoush
    ------------------------------


  • 2.  RE: URL Button to Preview File

    Posted 11 days ago
    try this

    IF(ToText([Document]) <>"",
    "<a target='_blank' href=" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/
    e999/v0"  & ">" & Totext([Document]) & "</a>")

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 3.  RE: URL Button to Preview File

    Posted 11 days ago
    .. field type would be Formula Rich Text

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 4.  RE: URL Button to Preview File

    Posted 11 days ago
    That works but just downloads it. I suspect it would be a preview if I changed my chrome settings, but Im trying to come up with something where it just works without changing the settings. Also would be great if it was a url formula so i could make it a button.

    ------------------------------
    Mike Tamoush
    ------------------------------



  • 5.  RE: URL Button to Preview File

    Posted 11 days ago
    And actually I tried what I originally posted, but as formula text instead of url and it also 'works', but downloads the file.

    ------------------------------
    Mike Tamoush
    ------------------------------



  • 6.  RE: URL Button to Preview File

    Posted 11 days ago
    When using Juiced Technologies' S3 upload; you can use a modal-window to "view" the file without downloading it.  Despite trying, we have not found a way to do this with a native file - if you (or someone else) by some chance figure it out; please share.  It would make a massive impact for users to be able to display a stored native file attachment in a pop-up window instead of having to download them.

    ------------------------------
    Laura Thacker (IDS)
    laura@intelligentdbs.com
    (626) 771 0454
    ------------------------------



  • 7.  RE: URL Button to Preview File

    Posted 11 days ago
    Laura,

    Yeah I was trying to replicate what juiced does. Bummer to hear no one has figured it out! I don't even need a pop up window, even just another tab on my browser would be good (that is how Exact Forms plus from juiced works for me).

    ------------------------------
    Mike Tamoush
    ------------------------------



  • 8.  RE: URL Button to Preview File

    Posted 11 days ago
    The URL formula button is actually easier to make

    URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e999/v0"

    And there is a setting as to if you open in a new window.

    As I understand it, the user's computer settings determine what to do with various file types
    There is a nifty (do people still use that word) trick that Kirk Trachy uses in his magic buttons app in the Exchange to do a live preview of most document types right on the form.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 9.  RE: URL Button to Preview File

    Posted 11 days ago
    URL button also downloads rather than previews. Regarding magic buttons, are you talking about the iframes preview?

    ------------------------------
    Mike Tamoush
    ------------------------------



  • 10.  RE: URL Button to Preview File

    Posted 11 days ago
    Yes, he has an example of how to setup some funky code as a formula text field and then using that field as both sides of a report link field..

    If([Document Attachment]="","No File",

    Ends(ToText([Document Attachment]),".jpg"),"",
    Ends(ToText([Document Attachment]),".png"),"",
    Ends(ToText([Document Attachment]),".gif"),"",

    "<iframe src=\"https://docs.google.com/gview?url="&URLRoot()&"up/" & Dbid () & "/a/r" & [Record ID#] & "/e6/v0 "&" &embedded=true\" width=\"600\" height=\"600\" frameborder=\"0\" target=\"_blank\"></iframe>")

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 11.  RE: URL Button to Preview File

    Posted 6 days ago
    Finally revisiting this. I can't use Kirks solution for security reasons, I can't have my file be available without a sign in. Other solutions still download the file, even when I checked my browser settings. According to one website "certain PDFs downloading automatically even if Chrome is configured otherwise. The reason lies when such PDFs are actually instructed from the server-side to download to your hard drive rather than open in-browser."

    I suspect that's what is going on here. I'm pretty lost trying to sort out Ryan Stanfords solution, as posted by Adam. Anyone else come up with a work around on this issue?


    ------------------------------
    Mike Tamoush
    ------------------------------



  • 12.  RE: URL Button to Preview File

    Posted 5 days ago
    Edited by Mark Shnier (YQC) 5 days ago
    Does anything more useful happen if you right click on the file attachment?  Perhaps more options?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 13.  RE: URL Button to Preview File

    Posted 11 days ago
    Reach out to Ryan Stanford, he was able to do it. Check out the last entry of this thread:
    video in pop up window

    ------------------------------
    Adam Keever
    ------------------------------



  • 14.  RE: URL Button to Preview File

    Posted 10 days ago
    @Adam keever, thanks for resharing the post. This is useful. I had the similar requirement recently to open the file itself when clicked. However, due to native, it only got download instead. I was using excel/word/ppt and pdf files. ​

    ------------------------------
    Babi Panjikar
    ------------------------------