Discussions

 View Only
Expand all | Collapse all

URL for File Attachment

  • 1.  URL for File Attachment

    Posted 01-31-2020 07:40
    We have a table that is setup to allow a file attachment (PDF) to the record created (no separate table for attachments in this case).  We would like to be able to directly link to the uploaded file somehow.  I have created a formula to do this, but the path being output is displaying an error when attempting to access it. 
    The URL from the formula matches the file URL up until the Record ID, where the QB record ID is numeric, the URL to the file is showing an alpha-numeric value.
    Anyone know what is generating the alpha numeric ID in this case?

    ------------------------------
    Jason Hartwig
    ------------------------------


  • 2.  RE: URL for File Attachment

    Posted 01-31-2020 08:23
    Can you post your current formula and also the resulting URL that you see?

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



  • 3.  RE: URL for File Attachment

    Posted 01-31-2020 09:06
    Edited by Jason Hartwig 01-31-2020 09:25

    Sure Mark.



    ------------------------------
    Jason Hartwig
    ------------------------------



  • 4.  RE: URL for File Attachment

    Posted 01-31-2020 09:13
    Maybe we should just try to answer your real question.  Are you trying to create a link to the file?

    "<a href='"& URLRoot() & "up/" &Dbid() & "/a/r" & [Record ID#] & "/e7/v0' target='_blank' >" & [File] & "</a>"

    Replace e7 with the exx  where xx is the field ID of the file attachment.

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



  • 5.  RE: URL for File Attachment

    Posted 01-31-2020 09:25
    That worked perfectly.  Thanks Mark!

    ------------------------------
    Jason Hartwig
    ------------------------------



  • 6.  RE: URL for File Attachment

    Posted 06-03-2020 15:17
    Mark, I have a similar issue which works great if there's a file.  However, not all of the records have a file attachment.  What's the code if the field is empty?  This is what I'm using:  URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e16/v0"

    ------------------------------
    Mike McCartney
    ------------------------------



  • 7.  RE: URL for File Attachment

    Posted 06-03-2020 15:25
    good point

    IF(ToText([my file attachment field])<>"",
    URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e16/v0")

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



  • 8.  RE: URL for File Attachment

    Posted 06-04-2020 08:29
    Perfect.  Thank you.

    ------------------------------
    Mike McCartney
    ------------------------------



  • 9.  RE: URL for File Attachment

    Posted 06-10-2020 11:50
    Edited by Jim Harrison 06-10-2020 12:11
    Looks like the & [Record ID#] & is no longer valid. Below are three different attachments, note between g/ and /e4 is rb**.
    Also you have e16/v0 and I do not, so new path.

    https://<realm name>/up/bpuds256i/g/rbgr/e4/va/<file name>.pdf
    https://<realm name>/up/bpuds256i/g/rbhv/e4/va/<file name>.pdf
    https://<realm name>/up/bpuds256i/g/rbib/e4/va/<file name>.pdf

    Edit:
    i see the records now contain "r" and then the record id. Meaning replace & Record ID & with /r" & [Record ID] &"/

    edit edit
    which is what Marc has, I missed the "r" damn these old eyes.

    ------------------------------
    Jim Harrison
    ------------------------------



  • 10.  RE: URL for File Attachment

    Posted 10-07-2021 17:04
    Thanks Mark!  This was just the solution I needed!!!

    ------------------------------
    Paul Peterson
    ------------------------------