I asked this question a few weeks ago and recently came back to it and solved it. I have a hidden input that looks like this:
<input style="display:none;" class="fileDialog" type="file" nwworkingdir="C:\Users\" nwsaveas/>
This opens a save dialog at the dir given to nwworkingdir
. I would like the default location to be the user's Pictures
directory but I am having trouble getting the system user name dynamically with javascript. I need the username because the path is usually C:\Users\USERNAME\Pictures. I have tried constants such as
ssfMYPICTURESand
CSIDL_PROFILE` but javascript doesn't recognize them or I am using them wrong.
The project is in node-webkit so a solution using javascript, node.js, or node-webkit APIs should work.