MariusUt
MariusUt

Reputation: 752

Opening html page as application

Background

I am writing a tool that steps through images in a folder. For each image file, that image is displayed and the user can edit the image. There is a "Next"-button which, when clicked, will save the current image and display the next image in the folder. I already have a codebase in HTML/JavaScript that displays images and enables all the necessary editing.

Problem

Since my code is as an HTML page, it runs in the browser. However, because of the security measures in the browser, this makes interaction with the file system difficult. In particular, I haven't found a good way to make a "Save" button that saves the changes directly to the file; when trying ot save the file, the browser requires that I download it like a normal file being saved to the computer.

Note that the page is not online - everything is run locally on the computer. In fact, I don't actually need to use the browser to run the javascript, I'm just doing it for convenience.

Question

Is there some neat way of allowing an HTML page to directly access your file system? Would it be possible to let the page interact with another program that runs natively on the computer? Other solutions?

Upvotes: 2

Views: 77

Answers (1)

Atmocreations
Atmocreations

Reputation: 10071

You could use a framework like AppJS or node-webkit. The "server-side" part of the code is all JavaScript/NodeJS and allows you to access files stored on the hard disk.

The "client-side" part consists of well-known web technologies and handles user interaction, it's actually just a webkit-based browser embedded into the app.

The beginning is pretty straight-forward and I had success using it for similar requirements as yours.

Upvotes: 1

Related Questions