File writing with HTML 5?

Hi there,

Is it enough to use Storage > “Write” with HTML 5 to write to a file, or are more/different steps required?
I’m trying the write function, but cannot find any such file being created in the gdtemporaries folder, or anywhere else on the computer. The browser (Firefox) developer tools are not reporting any file related errors either.

File writing is necessary to save states, stats, etc. and resume them later, so I’m fairly sure this works, I just need your help on what I’m doing wrong. Thanks. :slight_smile:

In HTML5 it is not possible to read and write local file system on the client computer for security reasons.
In case you want to read and write files on the server side you may need to use Javascript and you may also need to configure the server to allow your web app to read and write the server.

But in case you just simply want to save and load the state of the game, the storage action should work just fine. In HTML5 the storage action is using “web storage” so you won’t see any file because the information is stored in the web browser.

Thanks. Web storage is definitely what I was looking for. :slight_smile: Plus HTML 5 may actually allow local files (you can find plenty of apps that can work with offline files these days).

I don’t know much about this topic actually but HTML5 in the browser normally don’t and should not allow any web app to freely read and write the hard drive. Offline web apps might use some kind of wrapper and plugin to add the functionality to read and write local file system but I’m not sure what and how. Most wrappers I know just “wrap” the HTML5 app technically in to a browser and still can not read and write local files :confused:
Of course you can open (upload) files to the app and save (download) files from the app but ideally the app by itself can not read and write the actual hard drive.

It seems that you can, but only with a file that the user selects (although this shouldn’t be an issue for most apps, e.g. select the image file that you want to load…):

stackoverflow.com/questions/2376 … er#2378239

It does not necessarily need to upload that file. So you’re right that it cannot freely access the hard drive (which is great) but it can access files with user permission.