How do I save the location of a file downloaded as a string

Get help using Construct 2

Post » Thu Aug 17, 2017 10:15 pm

Hi,

I am using the browser object to 'invoke download string' to allow me to save data from my app into a .xml file.

I am using NWJS for my app and this method lets the user choose the location of the save file and its filename. (If you run it in Chrome only it saves automatically to your chrome save file folder).

I'd like to be able to save the file location and name to a string when the user clicks ok.

Is there a way to save this to a string, or force the browser download location to a set folder on the users computer?

Thanks,
B
38
S
11
G
1
Posts: 203
Reputation: 4,473

Post » Thu Aug 17, 2017 10:49 pm

Hi,

Maybe I miss something but if you use nw.js, why you don't use the action Write file in nw.js ?

regards,
Image Image
B
25
S
14
G
136
Posts: 876
Reputation: 71,005

Post » Fri Aug 18, 2017 5:22 am

Hi @madspy

When I tried to use write file in nwjs nothing seemed to happen. I couldnt find any examples online to check what I was doing wrong.

Thanks,
B
38
S
11
G
1
Posts: 203
Reputation: 4,473

Post » Fri Aug 18, 2017 3:37 pm

As an update I an using the prompt save dialogue to let the user choose a save location and give a filename.

I am then using 'on save ok' to write the file to the location (NWJS.chosenpath & ".xls")

This creates two files. i) filename and ii) filename.xls (I assume as I called the save dialogue ok action)

Does anyone know if there is a way to save just one file and allow the user to pick a location and file name in NWJS? I am also trying to store the file name as one variable and the save location as another.

Any ideas?
B
38
S
11
G
1
Posts: 203
Reputation: 4,473


Return to How do I....?

Who is online

Users browsing this forum: luvleggs and 12 guests