I am currently in the middle of developing a CRM, to be exported using Node-Webkit. I'm quite happy with my progress so far; the application is stable and extremely secure. It uses encryption, input validation (via regex), heavy filesystem expressions, etc.
However, there is one thing which is making part of it very difficult.
At the moment, the way it works is a user logs in and from there, they can choose to enter a new customer's details; once all details are entered, the application pops up a save dialog and allows the user to save the information they have entered as a print-ready XFDF file (Adobe auto-filling PDF). After it is saved, the application opens the file for convenience.
After this is done, a dialog box pops up asking "Do you want to save this customer's information?"
If yes is chosen, the application should automatically save an encrypted file with all the user's information, in a specific folder - formatted ready for viewing as a record in the application later.
The issue I'm facing, is that I cannot find a way to make Node-Webkit save files without the use of the Save dialog. It's important that this is done without letting the user choose the location or name, because the file needs to be saved in a specific folder (with all the rest of the customer files), with a specific name (auto-generated token).
I've tried a few different things including:
-Node-Webkit's 'Write File' action, using a preset path instead of telling it to use the input from the save dialog... nothing happens
-Browser's 'Invoke download of string' action... nothing happens
What's the best way to achieve this?
If I can get this working, it'd also be nice to make the XFDF file save in the background too, in a preset location and with a preset name, etc.