Forum Discussion
GraemeMATLAB
6 years agoQrew Member
Mark,
Thanks for your quick reply and the suggestion. I was optimistic about this solution but have tried it as well as several others and wasn't able to find anything that would force QB to refresh the image linked in this html img tag. In case this is useful for others, here is what I tried, as well as the final workaround I decided on:
1. Original: I had a small typo (missing backslash) in my original post. The original, working, formula url was:
"<img src=\"http://[local IP Address]/subfolder/filename.png" height = \"500\">"
This shows the source file as an embedded image in QB. However, when the image source file changed, the image displayed in QB would NOT update, even when refreshing the page.
2. Add a dummy text to the img tag as Mark suggested:
"<img src=\"http://[local IP Address]/subfolder/filename.png" height = \"500\" & DummyDateTime= "& ToText(Now()) & ">"
This had no effect; the image displayed in QB still does not update even if the source file is changed. I tried a few variations on this next.
3. Add an "alt" tag to the img tag, where the alt text is the current time, so that it should be different every time the user looks at the page:
"<img src=\"http://[local IP Address]/subfolder/filename.png" & "\"alt = \"" & ToText(Now()) & "\" height = \"500\">"
No effect; image displayed in QB does not update if/when the source file is changed, even upon refreshing the page.
4. Add some text to the field in addition to the image:
"<img src=\"http://[local IP Address]/subfolder/filename.png" height = \"500\">"&<p>&ToText(Now())&"</p>"
The text is displayed in QB below the embedded image, and the text updates each time you refresh the page. However, the image still doesn't update, even if the image source file has changed since the last time the page was loaded!
5. Make the size of the image variable based on the time:
var Number hgt = 500+Second(ToTimeOfDay(Now()));
"<img src=\"http://[local IP Address]/subfolder/filename.png" height = \"" & ToText($hgt)&"\">"
This worked to change the size of the image slightly each time you refreshed the page, but would not update the image itself, even if the source file had changed since the last refresh.
6. Each time the Image is overwritten on the server, check if the "Image" record showing this embedded image already exists in QB. If so, delete the record in QB and add a new record embedding the same filename, so that hopefully it should point to the latest source file. This also did not work - the embedded image remained the original file!
7. WORKAROUND: I am now including the current timestamp in the filename of the Image on the server. Each time the Image file is updated, this timestamp portion of the filename is changed, and the QB "Image" record is updated with a different filename to look for. A bit clunky, but this works, and achieves the result of getting the QB embedded image to update each time the file on the server has changed.
------------------------------
Graeme MATLAB
------------------------------
Thanks for your quick reply and the suggestion. I was optimistic about this solution but have tried it as well as several others and wasn't able to find anything that would force QB to refresh the image linked in this html img tag. In case this is useful for others, here is what I tried, as well as the final workaround I decided on:
1. Original: I had a small typo (missing backslash) in my original post. The original, working, formula url was:
"<img src=\"http://[local IP Address]/subfolder/filename.png" height = \"500\">"
This shows the source file as an embedded image in QB. However, when the image source file changed, the image displayed in QB would NOT update, even when refreshing the page.
2. Add a dummy text to the img tag as Mark suggested:
"<img src=\"http://[local IP Address]/subfolder/filename.png" height = \"500\" & DummyDateTime= "& ToText(Now()) & ">"
This had no effect; the image displayed in QB still does not update even if the source file is changed. I tried a few variations on this next.
3. Add an "alt" tag to the img tag, where the alt text is the current time, so that it should be different every time the user looks at the page:
"<img src=\"http://[local IP Address]/subfolder/filename.png" & "\"alt = \"" & ToText(Now()) & "\" height = \"500\">"
No effect; image displayed in QB does not update if/when the source file is changed, even upon refreshing the page.
4. Add some text to the field in addition to the image:
"<img src=\"http://[local IP Address]/subfolder/filename.png" height = \"500\">"&<p>&ToText(Now())&"</p>"
The text is displayed in QB below the embedded image, and the text updates each time you refresh the page. However, the image still doesn't update, even if the image source file has changed since the last time the page was loaded!
5. Make the size of the image variable based on the time:
var Number hgt = 500+Second(ToTimeOfDay(Now()));
"<img src=\"http://[local IP Address]/subfolder/filename.png" height = \"" & ToText($hgt)&"\">"
This worked to change the size of the image slightly each time you refreshed the page, but would not update the image itself, even if the source file had changed since the last refresh.
6. Each time the Image is overwritten on the server, check if the "Image" record showing this embedded image already exists in QB. If so, delete the record in QB and add a new record embedding the same filename, so that hopefully it should point to the latest source file. This also did not work - the embedded image remained the original file!
7. WORKAROUND: I am now including the current timestamp in the filename of the Image on the server. Each time the Image file is updated, this timestamp portion of the filename is changed, and the QB "Image" record is updated with a different filename to look for. A bit clunky, but this works, and achieves the result of getting the QB embedded image to update each time the file on the server has changed.
------------------------------
Graeme MATLAB
------------------------------
MarkShnier__You
Qrew Legend
6 years agoWow, thx for posting.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------