Displaying images uploaded to our instance in a custom widget?

Is there currently a method for displaying images uploaded to our Tulip instance within a custom widget?

Obviously due to the nature of AWS’s security, I’m assuming that a presigned URL is being generated or something along those lines, so just simply inserting an image in the widget’s HTML doesn’t work.

I’m attempting to create a “helper” widget that, when the user hovers over it or clicks it, it pops up a window with workbench instructions and at times an image so that the user doesn’t have to leave the step they’re on to view WB instructions.

Any help would be greatly appreciated.

1 Like

Hello Richard,
I don’t know if you still have this problem. But I can share a tip.

To display pictograms in Customs Widgets, I save them in a Tulip Table.
Then I click on the download button and I get a CSV file.
In this CSV file, pictograms are saved with a signed URL.
Now I can use these URL images in HTML or JavaScript code, for instance.

(Of course, for speed and space-saving, it is always better to use SVG pictures. :wink:)

I hope this could help you.

1 Like

Remi,

Thank you for the response.

I was able to utilize the “Sign URLS” API function to generate signed URLs, which resolved my issue.

I may be incorrect about this, but I believe that the signed URLs even in tables do have an expiration time. When viewing directly from the Tulip table, the URL contains: “Expires=86400” (so 24hrs) and in the exported csv, it shows a 3 hr expiration time. This may be something to keep an eye on in your use case.

Thank you again for the response.

You are right and it is a really strange point by the way.

If you use a sign URL in your browser after the expiration date, you will have the message: “Access Denied. Request has expired”.

BUT if you use the same URL in a custom widget, it works. The server probably don’t check the parameter “X-Amz-Expires” when the request come from a Tulip instance.

Remi,

Very interesting. I’ll have to give this a try in my custom widgets, as it would definitely be much easier than having to run a connector function to retrieve valid URLs for custom widgets.

Hey All-

A change to allow images to be used indefinitely in Custom Widgets is just beginning the code review process. This will ensure that any image passed to a custom widget will always be accessible to that widget (like you would see in the table UI, or anywhere else in the product).

This will take some time to land, but it is coming (probably r247, if I had to guess, but that might move based on the QA process and backlog).

Pete

Pete

2 Likes