Skip to main content
Question

Can a file attachment image thumbnail appear in a report?

  • January 29, 2013
  • 0 replies
  • 605 views

It would be nice if there is an option to display a thumbnail version of image file attachments. Is this possible?
This topic has been closed for replies.

Forum|alt.badge.img+6
  • Registered
  • January 29, 2013
This formula will put up a thumbnail.
//"https://www.quickbase.com/up/" & Dbid () & "/a/r" & //[Record ID#] & "/e6/v0\"height=\"1000\" width=\"1250\" target=_blank/> " &
"<img src = https://gesco.quickbase.com/up/" & Dbid () & "/a/r" & [Record ID#] & "/e6/v0\" height=\"300\" width=\"375\" target=_blank />"

note that e6 is the field ID # so change the 6 to whatever your file attachment field ID# is. eg e11 would be for fid 11.
adjust the height and the width of the thumbnail.

If you uncomment out the first two lines you would be able to click it to see a larger thumbnail, but it in neither case does it know how to scale the picture, so probably for full size undistorted viewing it would be best for your users to click on the file attachment file name if they want to see the thumbnail full size.

Don't be adding this thumbnail to large reports and certainly not to the List All report as it takes forever to load when there are hundreds of records.

  • Author
  • Registered
  • January 29, 2013
Hi Mark,
Thank you for this response!  I may be doing someting wrong.  I used the following from your formula:

�<img src = https://tamarataylor.quickbase.com/up/"; &
Dbid () & "/a/r" & [Record ID#] & "/e8/v0\" height=\"300\" width=\"375\" target=_blank />

I used the new interface.
I put this formula in a report (that has 14 rows).
I created a calculated column in the report; with a field type of URL.

The system is saying there is a syntax error of:  
     Formula syntax error
     A formula must be a valid expression.
           �<img src = https://tamarataylor.quickbase.com/up/"; &
           Dbid () & "/a/r" & [Record ID#] & "/e8/v0/" & height=/"300/" & width=/"375/" & target=_blank />

Forum|alt.badge.img+6
  • Registered
  • January 29, 2013
Try adding a closing " quote.   I missed that in my copy and paste.

  • Author
  • Registered
  • January 29, 2013
It's still failing.

Formula syntax error
There are extra characters beyond the end of the formula.
"<img src = https://tamarataylor.quickbase.com/up/";  ; &
 Dbid () & "/a/r" & [Record ID#] & "/e8/v0\" height=\"300\" width=\"375\" target=_blank />"

Forum|alt.badge.img+6
  • Registered
  • January 29, 2013
"<img src=\"https://gesco.quickbase.com/up/"; & Dbid () & "/a/r" &
[Record ID#] & "/e6/v0\" height=\"300\" width=\"375\" target=_blank />"

The above is what is working for me. In your post above, I am seeing some semi colons just after the "up/"   Are they really there?  If so, they don't belong there.

  • Author
  • Registered
  • January 29, 2013
Hi Mark,
I copied and pasted again - to make sure i didn't miss anything - and I am no longer receiving the error (hurdle 1 - accomplished).  :)
Pasted formula is:

//"https://www.quickbase.com/up/"; & Dbid () & "/a/r" &
//[Record ID#] & "/e8/v0\"height=\"1000\" width=\"1250\" target=_blank/> " &
"<img src = https://tamarataylor.quickbase.com/up/"; &
Dbid () & "/a/r" & [Record ID#] & "/e8/v0\" height=\"300\" width=\"375\" target=_blank />"

However, the image doesn't appear in the report.  The report shows a url instead.  When clicked, it takes me to the following url that doesn't resolve.  Example:

http://%3cimg%20src%20=%20https//tamarataylor.quickbase.com/up/bhtkhxhbj/a/r1/e8/v0%22%20height=%22300%22%20width=%22375%22%20target=_blank%20/%3E

It seems to be adding extraneous info in the beginning (http://%3cimg%20src%20=%20) and spacers in the end, Is there something additional I need to do?

Forum|alt.badge.img+6
  • Registered
  • January 29, 2013
Click the checkbox on the field properties to enable HTML. :)

  • Author
  • Registered
  • January 29, 2013
:)  I was trying to do it as a calculated column in the report - and not an actual field.  

I will work to add it as a field. :)  thanks for all of your assistance :)

  • Author
  • Registered
  • January 29, 2013
It works! thx.

  • Registered
  • April 6, 2013
Is it possible to do the same thing only for a video file instead?  Is there an html tag for embedding video?

  • Registered
  • April 6, 2013
Use the HTML5 <video> tag to embed a video.

  • Registered
  • April 6, 2013
I've been playing around with the <video> tag and can't seem to get it to work.  I was under the impression it was because the <video> tag was not supported.  Do you know for certain that this tag is supported?  Here's what the formula looks like:

"<video src=https://intersystems.quickbase.com/up/"; & Dbid () & "/a/r" &
[Record ID#] & "/e9/v0\" width=\"170\" height=\"85\" controls>\n<p>If you are reading this, it is because your browser does not support the HTML5 video element.</p>\n</video>"

  • Registered
  • September 11, 2013
Mark, I'm trying to get the thumbnail photo to enlarge as you mentioned will happen if the first 2 lines are uncommented. So this is what I have:

"https://www.quickbase.com/up/"; & Dbid () & "/a/r" &
[Record ID#] & "/e27/v0\"height=\"800\" width=\"1000\" target=_blank/> " &

"<img src = https://gesco.quickbase.com/up/"; & Dbid () & "/a/r" &
[Record ID#] & "/e27/v0\" height=\"200\" width=\"250\" target=_blank />"

When displayed though it shows  "https://www.quickbase.com/up/biajkmurz/a/r4/e27/v0"height="800"; width="1000" target=_blank/>" to the left of the thumbnail photo.

It appears that the top lines are missing an "<" but I tried putting it at the beginning and it still didn't work.
Can you help?

Thanks!
Ryan

yes, it look like my posted answer was missing the <a href part at the beginning.

Here is one that works. I see that when I pasted it in, this forum lost some of my formula. Note that you will need to remove the extra spaces in the h r e f and the and w w w

If you don't want a new window, then you leave out the target = blank.

"<a h r e f=\"h t t ps://mycompany.quickbase.com/up/" & Dbid () & "/a/r" &
[Record ID#] & "/e6/v0\"height=\"1000\" width=\"1250\" target=_blank/> " &
"<img src=\"h t t p s://mycompany.quickbase.com/up/" & Dbid () & "/a/r" &
[Record ID#] & "/e6/v0\" height=\"300\" width=\"375\" target=_blank />"

Also since I made that formula I now realize that you should just specify a width or a height (but not both), and it will automatically scale the missing one. If you specify both, then it forces an aspect ratio distort the original photo.

  • Registered
  • April 25, 2015
I can't find where I get the attachment ID

  • Registered
  • April 25, 2015
nevermind

  • Registered
  • April 27, 2017
/v0\ speaks to the version number. if you have something that may have iterations you will want to consider how best to approach it. I removed it from the coding, but it's probably not the best option. Is there a way to have it check the most recent version, like /v%\ or similar syntax?

  • Registered
  • April 28, 2017
v0 is the most recent version.  Odd I know.

v1 is the most recently replaced.

v3 would be the oldest available version if you allow up to 3 revisions, etc

  • Registered
  • April 28, 2017
When I had it as v0 the image preview did not update when it was replaced with a new image (not even v1, but deleted and replaced completely). 

It's an issue with cacheing in your browser settings.  I don't claim to b an expert and it will depend on the Browser you are using, but there will be a setting in their somewhere as to if the browser will chache content. They do that to speed up rendering on the screen, but the result is that it may render old data.

If you are stuck, let me know which browser you are using and I will have a look at my similar settings.

Ok I am pretty confused, I have copied and pasted everything, re-read the thread 20 times and just trying to figure out why nothing is showing up. This is what I pasted into my Text Formula field:

"<a href=\"https://xxxx.quickbase.com/up/"; & Dbid () & "/a/r" & 
[Record ID#] & "/e8/v0\"height=\"1000\" target=_blank/> " & 
"<img src=\"https://xxxx.quickbase.com/up/"; & Dbid () & "/a/r" & 
[Record ID#] & "/e8/v0\" height=\"200\" target=_blank />

I can help but just to be clear what you are you trying to do?  Are you trying to just display an icon  and the user will click to then display a file attachment?

Without putting much though into it yet, I see that there are semi colons in your formula in two places.  Can you try it by removing them and them post back your formula if that does not correct the problem.

  • Registered
  • March 20, 2018
It doesn't seem to be working for PDF attachments. Thoughts?

Forum|alt.badge.img+1
  • Registered
  • September 18, 2018
I answered my own question while typing this... seems like it would be worth sharing. 

I figured out how to hide the empty img preview field from the form.

Solution: 
Form rule--> When (attachment field) Photo 1 > 0, show Img preview


Forum|alt.badge.img+7
  • Registered
  • October 5, 2018
Hey Mark, thank you for all the info on this thread.  I have everything working except one small issue: I am trying to pull the image from a different Quick Base application where I host all my images.  The images are the front image of house plans. I created a url field in App1 --> House Plan table that uses a url from App1 --> image that I want to use.  The App1 field opens the image fine if I click on the link, but if I reference the App1 field ID in the formula for the thumbnail image, I just get a blank image placeholder.

My formula is:

"<ahref=\"https://www.quickbase.com/up/"; & Dbid () & "/a/r" & [Record ID#] & "/e35/v0\"height=\"1000\" width=\"1250\" target=_blank/> " &"<img src = https://prespro.quickbase.com/up/"; & Dbid () & "/a/r" & [Record ID#] & "/e35/v0\" height=\"60\" width=\"75\" target=_blank />"

Would you be able to help with this?

Thank you!