• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

HTML5 Read/Write files without using LocalStorage

M

Mathieu

Guest
Hello and sorry for my English.

If I understood correctly, with a HTML5 project, created or modified files are saved in the Web browser LocalStorage.

This is a problem for me :
-Firstly, when the user's Web browser is set to automatically clear LocalStorage (or when the user does it manually of course).
-Secondly, I read that the size of files in LocalStorage can be limited.

So I would like to know if there is another solution to save player data.
Thank you in advance for your help.
 

FrostyCat

Redemption Seeker
The only other way is to upload the saved data to a server and then loading it back later. Here is a crude example using files and PHP. Chances are you will need to add more security on top to make it work for real (e.g. user accounts, .htaccess controls, etc.).

Forget about writing directly to the file system, browsers won't ever permit that.
 
R

renex

Guest
Youc an use some clever javascript to cause a download with the save data, and use another clever piece of javascript to load back files picked by the user or dropped on top of the game.

This is also unsafe if you need any sort of hack protection.
 
M

Mathieu

Guest
Thanks you FrostyCat and renex for your ideas, I'll try.

Forget about writing directly to the file system, browsers won't ever permit that.
This makes me think : is there a software or an app (other than a Web browser) which can run HTML5 and allows writing directly to the file system ?
 
Top