Skip to main content
1-Visitor
March 9, 2018
Question

Is there a way to load HTML files in File Repository and add a link widget to display them?

  • March 9, 2018
  • 2 replies
  • 8515 views

I've loaded all the files to support an html help file in a File Repository.  When I reference them via a link widget with the following path:

https://<<localhost>>/Thingworx/FileRepositories/File_Repo/Help/index.html

it downloads the index file and it doesn't seem to recognize all the other files in the folder to add images, content, formatting, etc.  Any ideas?

2 replies

1-Visitor
November 22, 2018

I have same problem, anyone can help on that?

5-Regular Member
November 23, 2018

Hello,

 

The way the repository works is, that it's pre-configured by default to not execute the files within it, rather treat them as pure binary, downloading the file that was uploaded (html is simply considered a binary file and download is the default). This is a good practice and shouldn't be changed for various security reasons. As a alternative, you could put all necessary files to display a help Website in a archive, let the user download and extract it in a folder and view the help document from the index.html which will behave as expected. You could put the instructions in a label on the same mashup if necessary.

 

Let me know if you have any questions.

 

Regards,

Pascal

1-Visitor
November 23, 2018

There’s a dirty trick,

 

You can use an Html TextArea widget and FileRepository thing LoadText service, you set with LoadText path parameter with your html file and bind Content result to the TextArea text property.

 

Of course, links to other FileRepository files won’t work, if you want to show images, you can set it wilt the full file repository path for the file, something like: /Thingworx/FileRepositories/[yourFileRepositoryThing]/[yourImageFilePathAndName]

 

Regards,

Carles.

1-Visitor
November 22, 2018

Hi,

 

I have some html pages which I would like to open from a mashup using the link widget or a service and a button, any way it works for me is fine. The pages are stored on the Thingworx repository. The maximum I could do using the link widget, thingworx try to download the page instead of open it.

 

Thanks!