How to run html with json files in SharePoint? - json

I am making SharePoint spaces for various departments in insurance company. One of them wants to save and share their outputs via SharePoint. That outputs are maps with risk areas. Because maps includes many data layers, all the files are in one folder.
I have uploaded a folder with CSS, JSON, JS and HTML files to the library in SharePoint, but when I doubleclicked on HTML file, the page will not load. I think it's due to the JSON files.
What I need is to run whole page correctly with simple doubleclick.
Can anyone give me advice how to run other files supporting HTML with doubleclicking on HTML file?
Thank you.

I've had this same issue. To get the HTML to play in the browser (without SharePoint trying to make you download it), you need to rename the HTML file to an ASPX file.
To do this, you need to be in the Windows Explorer view (from a document library, go Library > Open with Explorer). Then change the file name from index.html to index.aspx.
However, if you're also using JSON files, that could be an issue. SharePoint prohibits you from uploading JSON files unfortunately.

Related

Flutter render downloaded html

I have an elearning APP in Flutter, which can render html files stored online. Now I want to download these files to assets, so they may be accessed offline. For this, I will download a zipped file with the entire html's folder and unzip it.
The problem is the html has many subfolders with it's own assets, which I would have to declare in the pubsp.yaml in order to access, but these downloadable htmls are constantly being added (every new course has new files).
I see a few ways to solve the problem:
Somehow declare access to subfolders in the pubsp.yaml.
As far as I know, this cannot be done.
Update the folder access for the installed APP dynamically.
As far as I know, this cannot be done.
Read the html file without unziping it.
I don't know if this is doable (I'm using webview_flutter_plus to render) and weather it would allow access to files in folders inside the zip without declaring them in the .yaml.
Pre-load empty folders inside assets that would mimic the html folder structure, declare them in the .yaml and then unzip and read the htmls from these folders. I would create some 100 of them in order to accomodate a large number of course downloads.
I believe this method would work, but it seems very cumbersome and inelegant.
So my questions are:
Would any of methods 1-3 work and if so how?
Would method 4 work?
Is it possible to reference folders in the .yaml file without them existing? It would make method 4 far easier.
Is there any other way to accomplish this? I cannot change the language, since the APP is months along, but plugins are fair game.
Thanks in advance!

Can I compile with electron-build and keep my html files?

I'm using electron-build to transform a "website" into an "app" and it's pretty awesome! But the compilation process obviously transforms the HTML pages into other types of files.
Is there any compilation option, flag or anything that can allow me to keep the html files and resources so that a curious user can click on index.html and use the app in their favorite web browser?
I havent found anything, so I'm considering simply copy pasting the source files in the output folder, but that's a lot of duplicate data :)
Thanks!

View all documents in ng2-pdf-viewer

In npm ng2-pdf-viewer is it possible that we can view images, excel, and other documents. I have base64 string of all documents but I want to view not only pdf but all documents. Is it possible? If so, can anyone help me?
As the repo details it, ng2-pdf-viewer is just for PDF files. If you need to display Excel documents, photos, and so on, you should use a different component.
You can make a function that picks which component to use depending on what file type you have, but you cannot display them all in ng2-pdf-viewer.
ViewerJS is an example of a Framework that supports both PDF and office documents (Open Document Format).

How can i embed a file, committed on svn, into my html page?

Is there anyway that I can display an xls file committed on SVN onto my webpage(HTML) in an iframe or something?
I'm not 100% sure what you're asking/expecting but here is what is possible:
You can commit an XLS file to an SVN repo
Assuming you can make that SVN repo public (or access it from the web server) you should be able to display it on a webpage, but only as a link to the file, which others can download.
If you want to actually display the contents of the XLS you would have to read the file in code, and display it in a table you create in code
You could do something like convert the file to a Google Doc, and display that in an iFrame (From memory their API is pretty good so you could likely interface with their API to write some code to upload the file etc)
You could use other frameworks or similar to load the data into table like structures in HTML e.g http://www.datatables.net/

Embed HTML + javascript files in Visual Studio Winforms Project

I'm having a hard time trying to integrate some things I thought they would be easy to integrate, but I was wrong.
I have an html file and some javascript files (with no server logic in the html code) and i need to embed them in a Visual Studio winform Project in order to use a WebBrowser control an invoke this html file (which includes the .js files) and I need to have the files inside the client application when I call them.
How can I achieve this?
Thanks in advance!
If everything is in one file, you can embed the file in a ResX container and write
webBrowser.DocumentText = Resources.HtmlSource;
If you have multiple files (eg, images and external .js files), you'll need to copy them to physical files on the end-user's machine to make relative paths work. (or you could put them all into a .mhtml file)