Discussions

Expand all | Collapse all

Displaying a small image of an attachment.

  • 1.  Displaying a small image of an attachment.

    Posted 11-01-2018 22:30
    I have a File Attachment field named Picture 1 which is used to attach pictures of the equipment being serviced. 

    Right next to the attachment field, I want to display a small image of the picture.  This works OK, except if when a revised image is added to the Picture 1 field, the formula field be still shows the original picture.  I thought the v0 parameter would make sure to show the current version of the attachment.

    Formula field that displays a small image of the attachment field:
    If([Picture 1]>"","<img src=" & URLRoot() & "up/" & Dbid () & "/a/r" 
    & [Record ID#] & "/e183/v0\" height='200';>","")


  • 2.  RE: Displaying a small image of an attachment.

    Posted 11-01-2018 22:34
    This has to do with your computer cacheing images to improve performance in loading web pages, , but I don�t recall offhand where that obscure setting is, and it would depend on your browser. You will need to google like chrome image cacheing disable


  • 3.  RE: Displaying a small image of an attachment.

    Posted 12-15-2018 20:31
    I created a formula URL but instead of showing the thumbnail picture, it show the link code...



    http://<img src=https://fixandpaint.quickbase.com/up/bkkhbuvmj/a/r76/e36/v0" height='200';>


    The actual formula is:

    If([Picture]>"","<img src=" & URLRoot() & "up/" & Dbid () & "/a/r" 
    & [Record ID#] & "/e36/v0\" height='200';>","")

    where the image field name is Picture and the fid is 36.

    Can you help with what I am doing wrong?


  • 4.  RE: Displaying a small image of an attachment.

    Posted 12-15-2018 20:33
    Try changing the field to a formula Rich Text type if it is still a formula text field type.


  • 5.  RE: Displaying a small image of an attachment.

    Posted 12-16-2018 14:26
    Thanks for the suggestion, the field was a formula url referencng an attachment field... I changed to be a formula Rich Text but it does not show the attachment as a thumbnail.

    The attachment field has the "Show .jpg, .png and .gif files as images in forms"  checked.

    Any other thoughts??? 


  • 6.  RE: Displaying a small image of an attachment.

    Posted 12-16-2018 14:30
    Got it... I removed the "If([Picture]" and it is working perfectly... thanks for the rich text suggestion.  For reference for others that might stumble upon this... the final definition that works is:

    Have your file attachment field.
    create a new formula Rich Text field.
    define the formula for new field:

    "<a href=\""  & URLRoot() & "/up/"& Dbid () & "/a/r"& 
    [Record ID#] &"/e36/v0\" /> "&
     "<img src=\""  & URLRoot() & "/up/"& Dbid () &"/a/r"& 
    [Record ID#] &"/e36/v0\" height=\"200\"alt='' />" & "</a>"

    Where the 36 in e36 is the fid of the file attachment field.


  • 7.  RE: Displaying a small image of an attachment.

    Posted 12-16-2018 15:54
    Your solution is working but only if there is an image. If there is no image then rather than displaying a nice clean blank space it will have sort of a broken picture image.

    The solution is to reinstate your IF

    But like this

    IF(totext([file attachment field])<>"",

    Then everything else

    Then close the )


  • 8.  RE: Displaying a small image of an attachment.

    Posted 12-16-2018 16:37
    Thanks, that worked great.