-
Nov 8th, 2021, 09:17 PM
#1
Thread Starter
Member
write to system storage
aside from using cookies or localStorage, how can I use javascript to write to a file in windows OS, android OS or ios OS ?
-
Nov 9th, 2021, 04:38 PM
#2
Re: write to system storage
The short answer is that you cannot.
The long answer is that JavaScript is not allowed to access the file system at all and that most (if not all) browsers have security restrictions to prevent this. Just imagine the security concerns if browsers allowed any website to create files.
If you want to write to disk then you will need to setup a web server and do the IO operations from there. This operation can be triggered by an AJAX request if needed.
-
Nov 9th, 2021, 05:08 PM
#3
Thread Starter
Member
Re: write to system storage
I asked this coz i need to write text to file in an ndroid or ios operating syatem. any advice?
-
Nov 9th, 2021, 07:51 PM
#4
Re: write to system storage
Are hosting a native app?
-
Nov 9th, 2021, 07:54 PM
#5
Thread Starter
Member
Re: write to system storage
no, just a website. I just dont like that my cookie or my data be deleted when they clear the app cache because it store data about login and registration.
-
Nov 9th, 2021, 07:57 PM
#6
Re: write to system storage
Again, you are not able to just from the browser.
-
Nov 9th, 2021, 07:59 PM
#7
Thread Starter
Member
Re: write to system storage
should i just do it with the native android app?
-
Nov 9th, 2021, 08:30 PM
#8
Re: write to system storage
You could, but an easier approach may be to use cordova with Angular since you have some JavaScript experience.
-
Nov 9th, 2021, 08:35 PM
#9
Thread Starter
Member
Re: write to system storage
Originally Posted by dday9
You could, but an easier approach may be to use cordova with Angular since you have some JavaScript experience.
Can I have a learning example ? Oh I think that would be lengthy.
-
Nov 9th, 2021, 11:12 PM
#10
Re: write to system storage
Yeah, that’s a whole learning experience. I’ve been thinking about making a tutorial but man it’s a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|