Skip to main content
1-Visitor
August 12, 2016
Question

Loading image file in thingworx repository to image widget in mashup

  • August 12, 2016
  • 1 reply
  • 11801 views

Hi,

Anyone please help me. I am uploading images to thingworx repository. But, i don't know how to access the image file and display in mashup using service. Please any one suggest, is there any way?

1 reply

5-Regular Member
August 15, 2016

Hello,

In order to load the image in a mashup, you need to use the value display widget and the LoadImage service from the file repository. Here are some steps for a very basic version:

  1. Create a new mashup with a vertical layout that has one row and a header
  2. In the header, put a text box and a button
  3. Import the LoadImage service from your file repository
  4. Bind the text box "Text" field to the "path" parameter
  5. Bind the click event of the button to call that service
  6. In the row, drag and drop a value display widget
  7. Drag "Content" from "AllData" of the LoadImage service to the value display widget
  8. View the mashup and type the path to the image file and click the button.

Here is what mine looks like:

I hope this helps!

Tori

1-Visitor
October 12, 2016

Hi Tori,

I have a image file Flag.jpg at location. C:\ThingworxStorage\repository (I assume its Thingworx repository)

repository.PNG

I followed the steps mentioned in above post & created Mashup. But when type /Flag.jpg in as image path and click button, image did not get displayed.

This my connections in composer.

Am I missing something?

5-Regular Member
October 12, 2016

Mithun, I believe it's not working in your case because you've chosen a dynamic service from the FileRepository Template itself (it doesn't know which repository to go to). You would need to either give it your repository name or select your repository directly (for example SystemRepository).

Try moving your image into SystemRepository (ThingworxStorage\repository\SystemRepository) and then use the LoadImage service on SystemRepository.