Display Image from Data Link
I am trying to display an image from a data link, and I am running into issues.I have established the data link, and in the feature description I am using the syntax {DataLinkID.ColumnName}, but I can't get anything to display. Does anyone know whats going on? I am able to show data from other data links in the site, but when I try and display any attachment data it shows nothing. Any Suggestions?
0
-
Good morning Andrew,
Are you looking to display an image from the web or your webserver somewhere? What attribute data is in 'DataLinkID.ColumnName'? If it is the name of the image you should be able to do something like this:<img src="http://www.anywhere.com/{DataLinkID.ColumnName}.jpg" width="100%" alt="No Images available"/>
You also mention that you are trying to get attachment data to show, is that what the datalink is pointing to?0 -
Hi Marshall,
I am trying to display an attached image. I was trying to establish a datalink to the attachment table and go from there, but I can't get any attributes to display from the datalink. Is there another way to access attachments? Thanks!0 -
Hi Andrew,
First thing to note (to my understanding) is you're only going to display the first attachment found if there are multiple attachments.
This is an example of what the data link looks like for my 'graves' featureclass to its corresponding attachment table which shows headstones. I'm only pulling attachmentID and rel_globalID with a join from globalID to rel_globalID:
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000TURM&feoid=Body&refid=0EM60000000M0Qv" _/_img_
Then, in my feature description I do the following:<img src="https://gis.miottawa.org/proxy/proxy.ashx?https://gis.miottawa.org/gisweb/rest/services/ByOwner/Parks/MapServer/32/{OBJECTID}/attachments/{Attachments.ATTACHMENTID}" width="100%" alt="No Images available"/></p>My service is secure, which is why I place the proxy url before the service, then use the {OBJECTID} token after the service, with your datalink after attachments.
As an example, check out this page: https://gis.miottawa.org/Ottawa/Geocortex/CemeteryViewer and do a search on 'Schermer' and some will have images and some will not.
Hope this helps,
Marshall0 -
Thats just what I was looking for!
However I cannot get any attributes to display from the datalink to the attachment table. I have a feeling that it has something to do with security, is there a way to add a token to the datalink, or something along those lines. Thanks!0 -
instead of 'Select AttachmentID, rel_globalID ...' use 'Select * ' then you should have access to all attributes of the attachment table.
Or when you sent up your datalink, select all the attributes you want to return. If you don't select any, they should all return.
For me the only other fields I have are from the default setup: 'ContentType' and 'Size'.0 -
Hi Marshall,
The command I use includes "Select * ", but I still am not able to display any attributes in the description. When I identify the feature and click on the attachment I noticed that the URL includes a token at the end. So I am wondering if I need to generate a token to display attributes from the data link. Can that be done?0 -
What does your description look like and what attributes from the datalink to the attachment are you trying to display? I wouldn't think you would need to add a token unless you are trying to view the attributes in a window outside the application
Is this site publicly accessible that I could look at?0 -
Hi Marshall,
Unfortunatly the site is not publicly accessible, however here are the steps I have used to create the connection.
1. These are the settings set up for the datalink.
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000TUSj&feoid=Body&refid=0EM60000000M0kM" _/_img_
2. Here is an example of what I put in the "Feature Long Description"
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000TUSj&feoid=Body&refid=0EM60000000M0kR" _/_img_
3. This shows what I see on an identify.
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000TUSj&feoid=Body&refid=0EM60000000M0kW"_/_img_
I have used similar steps to display data from a linked table I created, but it seems like linking the attachment table causes these issues, and I'm not sure what the difference is. Thanks!0 -
Andrew,
Have you used Fiddler before to see what might be blocking it? Also, sometimes it takes a minute to appear when you load the details as well.
I just added 'ATT_NAME' to mine as well and it is appearing just fine:<img src="https://gis.miottawa.org/proxy/proxy.ashx?https://gis.miottawa.org/gisweb/rest/services/ByOwner/Parks/MapServer/32/{OBJECTID}/attachments/<b><u>{Attachments.ATTACHMENTID}</u></b>" width="100%" alt="No Images available"/><br><b><u>{Attachments.ATT_NAME}</u></b></p>When I check fiddler, I get the following result after a couple seconds:
code 200 (success)
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000TUTS&feoid=Body&refid=0EM60000000M0kl"_/_img_
And one final thing, I have mine set to 1:1 instead of 1:many for my relationship type. I don't know if that would affect it or not.0
Please sign in to leave a comment.
Comments
9 comments