Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / How do one get html5 app to open a file and save a file?

Author
Message
Chmava
8
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Aug 2021 17:07
As the title stated, How do one get html5 app to open a file and save a file?

Any help appreciated!
hosch
Developer
User Offline
Joined: 25th May 2021
Location:
Posted: 10th Aug 2021 17:57
May I ask what you are trying to accomplish? If it's about a save file, you might be better off using shared variables in my opinion. I could provide an example how I mange saves in ORBITER, if you want. There is a special case when using Edge, VirtualNomad kindly pointed out a fix by tboy, which I could provide as well.
Chmava
8
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 11th Aug 2021 08:08
I was trying to open folder, but all I get is '/'.
GetReadPath() ashow only '/'.
I am not sure how to read and write to and from the document folder...
hosch
Developer
User Offline
Joined: 25th May 2021
Location:
Posted: 11th Aug 2021 12:56
I believe it is not possible to access userfiles with HTML5 only. Besides, GetReadPath() would return the path AppGameKit is allowed access to/where the executable resides - which in HTML5 would be an empty string, like you described.
Chmava
8
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 14th Aug 2021 05:51
I can't get the browser to save data locally as well...
Once the app relaunched, everything is gone!
hosch
Developer
User Offline
Joined: 25th May 2021
Location:
Posted: 18th Aug 2021 03:57 Edited at: 18th Aug 2021 03:57
It would be really helpful, if you could elaborate on what you are trying to save and maybe share the code. If you are using shared variables, try Firefox first, because there is an issue on Microsoft Edge.

If it works in Firefox, you are good to go, there is a fix for Edge and supposedly other browsers here.
Chmava
8
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 20th Aug 2021 09:16
I also wish top open something in the 'document' folder and save to the 'document' folder...

Login to post a reply

Server time is: 2021-10-27 05:23:14
Your offset time is: 2021-10-27 05:23:14