I'm leveraging Node-red's dashboard web site (.../ui, which maps to <NR home>/node_modules/node-red-dashboard/dist), to store & load web resources, such as HTML pages, images etc.
When I try to load an HTML file (created from an Excel sheet via 'save as HTML'), it comes up perfectly when I call it as a file (file:///C:/ProgramData/Node-red/...), but when I call it as a web resource (http://localhost:1880/ui/...) it loads with data encoding issues as follows:
Does anyone have a clue what could be the root cause of this?
Sorry for not responding earlier (I was away).
The generated HTML is composed of a main file plus a linked subdirectory with resource files. It is quite complex (over 300 lines just for the main file). Below a few extracts:
What does that mean?
Are you loading the file via a file in node & sending it to an endpoint?
Are you loading the file via a file in node & sending it through a template node?
Are you pasting the entire content into a ui-template or template node?
Are you serving the spreadsheet files via a static path?
If you open the browsers developer tools and watch the "Network" tab, do you see any failed GET requests? (i.e. missing resources)
Let me explain.
I'm trying to piggyback the Node-red dashboard and leverage it as a general-purpose web server for showing reports & images.
Here I'm not referring at all to uploading files via Node-red nodes, but rather to loading resources directly from a web browser.
In my system, the Node-red dashboard root is C:/ProgramData/Node-red/node_modules/node-red-dashboard/dist
Now suppose I have an HTML report (converted from Excel) called my_report.htm in the above root folder. In the browser, if I specify the URL file:///C:/ProgramData/Node-red/node_modules/node-red-dashboard/dist/my_report.htm the page comes up perfectly. However, if I call it as http://localhost:1880/ui/my_report.htm it comes up with the encoding errors (but no errors showing in the browser "inspect" console).