Where to store application data for webapp? - html

I have some data for a webapp that I would like to store on the server. What would be a good location to put those files?
I have a couple of static HTML pages that contain instance specific information. They need to survive a re-deploy of the webapp. They need to be editable by the server's administrator. They are included in other HTML pages using the html object tag.
I want to store preferences on the server, but cannot use a database. I am using JSP to write and read the preferences. There is no sensitive data in the preferences. Currently I am using the log directory. But obviously that is not a great choice.
I am using Tomcat. I thought of creating an appdata/myapp directory under the webapp directory. Is that good or bad?

If the server's administrator can also deploy the app, I would add the data file itself into the source control for the app, and deploy it all together. This way you get revision control of the data, and you get the ability to revert to known good data if the server fails.
If the administrator can't deploy the app, but can only edit the file, then you need plans to back up that file in the case that the server or server filesystem dies.
A third solution would be a hybrid: put the app in one source code repository. Put the data in a second source code repository. The administrator can edit the data and deploy the data. The developer can edit the app source code, and deploy the source code. This way, both are revision controlled, but you've separated responsibility for who maintains what.

Related

How to deploy resource files for a windows store app

I am working on a windows store app, one of the workflows within the app would allow the user to export a report in html format. The html report relies on a css file so I would like to ensure that the install process could deploy the file in a local folder. If not I would need to read out the file from the assets folder (within the install bundle) and manually write it out but that seems pretty kludgy
https://learn.microsoft.com/en-us/uwp/api/Windows.Storage.KnownFolders?view=winrt-22000
mentions that "The Documents library is not intended for general use." so would require use through file picker but I would prefer to be able to export the document without user intervention without additional store approval headaches (apparently adding Documents library capability to manifest requires additional Microsoft store approval).
Questions
When I create files within the store app it seems the location options are limited and I can only write to Localfolder (which is actually hidden and users cannot easily get to it) - There must be a way to create a file within the MyDocuments directory that is easily accessible by users but looks like that is off limits to a windows store app? So what is the best approach to write reports to storage that can be easily accessed by users
How can one deploy files to a specific directory during install time? Assuming there are some installer commands/manifest directives that would allow this capability?
Or maybe there is a entirely different mechanism to allow for this functionality within the store app and I am just looking in all the wrong places...

Ionic 5: How to write to local JSON files?

I'm developing an Ionic-Angular mobile application that involves tracking user progress. While I'm familiar with how to read from locally defined JSON files (and render that data), I've been unable to find any solutions online to write/append to local JSON files.
Until I'm able to utilize something like Google Firebase, I'd like to be able to just store this data by writing to local JSON.
Is there any way I can do this or is a database the only solution?
I'm assuming this is a web application. There is no way you can access the file system of the user to persist the data.
Other options
Index DB (save the information locally to the user at the browser level). User can go to the mobile device settings and clear it if required.
Use a mock api if this is only during the local development purpose (Use json-server and watch the database json file. You can update the database json file and it will reflect)
If you are building a hybrid application using ionic, then use one of the cordova plugins available here.
Use an actual backend service which persists it in the database.

Python Web Crawler with stored Web History

I'm Creating a Python Web crawler, with the ability to browse web history & parse through the information and store important information within a Database for Forensics/Academic Purposes. I understand the functionality to browse web sites but the part I'm struggling with is to be able too crawl through web history I will give a scenario:
During Forensic Investigation.
You have been given a full Forensic Image of Suspects Computer, you then locate the AppData folder for Google Chrome which stores all information about suspect including form information, credentials & web history.
How would I set up the web crawler to only search through data in the suspects web history.
I am also having issues accessing the information stored within Google Chrome User Data to try view my personal information which is stored here as a start, I am currently attempting to use DB Browser to view the files to try see my own web history however I'm not having much luck with this. Any Suggestions
For those interested in this project of mine I can update this thread as I go so you can see the progress of my web-crawler the end result will have the ability to take web-history and data from public & private websites sort important information i.e. name, address, D.O.B into a database for to be used later as a biographic dictionary.
I WILL STRESS THIS AGAIN AS THIS IS ALL FOR ACADEMIC PURPOSES IN CONTROLLED ENVIROMENT AND USED ON A TEST/FAKE ACCOUNT
Hindsight (https://github.com/obsidianforensics/hindsight) is an open source tool written in Python that can parse a ton of information from the files in /Google/Chrome/User Data/ directory.
You could look at it's source for inspiration, or just run the tool and parse its output (it can produce XLSX, JSON, or SQLite) in your crawler.

Can chrome extension modify a file in our hard drive?

I am making a chrome extension which needs to add/delete/modify file in any location in our hard drive. The location can be temporary folder. How is it possible to make it. Please give comments and helpful links which can lead to me have this work done.
You can not, but adding a local server (nodejs/deno/cs-script/go/python/lua/..) to have a fixed logic (security) to do file stuff and providing a http server to answer back in an ajax/jsonp request would work.
The extension will not be able to install the software part.
edit: if you want to get started using nodejs, this could help
edit2: With File and Directory Entries API (this could help) you can get hold of a FILE OR complete FOLDER (getDirectory(), showDirectoryPicker()).
Thankfully, this is impossible.
Google or any other company wouldn't have many friend if their extension(s') installation caused compromise including complete control over any files(ie. control over machine) on your hard drive. The extension can save information to disk in a location that is available for storing local information as mentioned. You will not have any execute permission on the root or anywhere nor will you have any read or write permission outside of the storage location.
However, extensions can still be malicious if they gather information from a user of a web page (I am sure that Google can filter some suspicious extensions).
If you really need to make changes on your hard drive you can store information on a server and poll for changes with a windows client application or perhaps you can find where the storage information is kept and access it from there from a windows app.

Is it possible to open an excel file in its current location not download it

I am writing a small web site for a company Intranet and have the following question that may be simple. Is it possible to open an Excel file from it's current location on the network instead of downloading it. So that any changes made are made to the actual file and not a downloaded version of it?
Thanks
Matt
Yes, it's possible, but then you would have to specify the address of the file in the local network, not as an HTTP address on the web server.
The user would naturally need to have access to the file on the network share, with write permission.
No. It is not possible to open a remote excel file across HTTP and write changes back to it.
Let's consider some other things you might be trying to do.
If you are running excel, all you can open are files visible to the file system APIs. That means files on your local disk and network file systems accessible via CIFS. Mapped drive letters, \\ pathnames, that sort of thing.
If you set up an Excel file for download from a web server, it will always be downloaded. Excel won't open it 'in place'.
The Microsoft technology solution that addresses what you seem to be asking for is Sharepoint.
Anything you open from a HTTP connection I believe is "downloaded" to the client. Its more how you "uploade" the changes.
But if thats what the customer wants I have some alternatives:
1) Use Dropbox or similar filesharing utils. Once someone saves a document in Dropbox, its automatically uploaded to the Dropbox account. The free version allows up to 2 GB of data. Thats quite a few Excel files.
2) Use Gmail/Google Apps. If you do you get 1 GB space for online documents. You can upload Office files suchs as Excel and they will be converted an online editable from within the Google Docs. You can share the files within the domain or even externally if you make that setting the admin part. Afterwards you can also download/export the Spreadsheet as Excel format. I havent tested how much of the standards you loose but ofcause its not a full Excel.
3) wait for Microsoft to finish their Office online. I bet that Excel version will do exactly what you are currently asking for by using some special plugin or MSIE9 technics. But I dont really know yet.
Hope some of this gave you some ideas?
If the file is in a network share on the same domain (or reachable from the domain your app is running from), it is possible, provided that
The share is readable and writeable by the domain\user the app runs under (via ownership or assigned role.)
The file is shareable (IIRC). This is important if multiple users (or apps) need to access it.
Other than that, a \domain\location path should be treatable just like a local (or disk mounted) path.
In your HTML document, create/place a link:
<a href='file:///H:/docs/foo/bar.xls'>Your Excel File</a>
Substitite your network UNC path for H:/docs/foo/bar.xls. Note the slashes instead of the regular UNC backslashes.