Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
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?
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:
Here is what mine looks like:
I hope this helps!
Tori
Hi Tori,
I have a image file Flag.jpg at location. C:\ThingworxStorage\repository (I assume its Thingworx repository)
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?
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.
Thanks Ravi, it works
I have a question here
Is this SystemRepository path (C:\ThingworxStorage\repository\SystemRepository) is fixed?
What I am trying to achieve here is
1. I am using .Net SDK
2. I am create Thing there and one of its service create an image from xps doc & saved at certain location.
3. This service also returns the saved image path.
4. I have to display this image in Thingworx mashup by connecting to thing created in .Net code.
5. I could able to connect the Thing (by creating remote thing in TWX and binding it) but from from image path i could not able to display image on Mashup.
6. What I am planning here is, if this SystemRepository path is fixed then will saved the image at SystemRepository location & display it on mashup using LoadImage service on SystemRepository.
I am new to Thingworx and I am not sure I am doing it in right way or not.
The path is always fixed. You can create your own Repository Thing as well, instead of using the SystemRepository. Just create a new Thing based on the FileRepository Template, and the path would now be C:\ThingworxStorage\repository\Your_RepoThing
Hi guys,
Does this solution worked? I've been trying it with no success. Can you give me some further advice?
Thanks on advance.
Hello Jousue,
Yes this solution works for me.
Can you mark the solution as correct if it works for you so others can more easily find this solution in the future? Thanks!
It was a temporary solution. When I display a picture in a Value Display widget, I cant handle the size or fit it the way I do with a Media Entity widget so it was just a work around for the solution I was looking for.
Do you know how can I make the image fit to the value display widget. I can't handle the size of the image as it is taken from any type of device (Smartphone or Tablet).
Can something similar be done with rich text file content? Is there a widget that displays rich text?
I followed Tori's instructions but used LoadText in place of LoadImage and a TextArea widget in place of the ValueDisplay widget. The logic works but what is displayed is not the nicely formatted text but the raw contents of the rtf file ...
Andy, I don't believe you can display an rtf directly on the browser. It needs to be parsed into html and then displayed/ rendered.
Thanks, Anjan.
It looks like there are a number rtf to html converters out there. I just wonder what other community members are using.
-Andy