Write json to file locally via browser [closed]
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a requirement which i need some input on, I am using a very outdated version of xojo for a legacy application, the requirement is i need to open a webpage on the users system which isn't connected to the internet!
So i have a folder containing a website on its entirety, when i open the index.html file it loads all the resources locally and does not require anything to be download or access the internet.
Now on this website the user performs some actions like a survey or a guide as an example and i need to record all these actions and store it on a file so that later when the user is connected to the internet i can upload the files to the server.
How can i write json data to a file on the users pc via IE/Chrome/Firefox/Safari using javascript? Any ideas will be helpful.
javascript jquery html json xojo
closed as too broad by phuzi, cнŝdk, ADyson, Graham, atline Nov 16 '18 at 3:31
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
|
show 4 more comments
I have a requirement which i need some input on, I am using a very outdated version of xojo for a legacy application, the requirement is i need to open a webpage on the users system which isn't connected to the internet!
So i have a folder containing a website on its entirety, when i open the index.html file it loads all the resources locally and does not require anything to be download or access the internet.
Now on this website the user performs some actions like a survey or a guide as an example and i need to record all these actions and store it on a file so that later when the user is connected to the internet i can upload the files to the server.
How can i write json data to a file on the users pc via IE/Chrome/Firefox/Safari using javascript? Any ideas will be helpful.
javascript jquery html json xojo
closed as too broad by phuzi, cнŝdk, ADyson, Graham, atline Nov 16 '18 at 3:31
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Is there a reason they're not online, or is it just poor connectivity? There's typically no way to write a file to the file system directly from a browser (it's a bit of a security risk) without prompting them to download a file.
– phuzi
Nov 15 '18 at 15:11
There is, they use this legacy application in a no internet environment at certain client locations, is there a way to write to a already existing file in the local folder where the html file is located?
– The Confused Coder
Nov 15 '18 at 15:43
Creating files and saving it in storage is a server side act. Your application is similar to browser itself. So it can not be done directly. You have to access server side resources of that device.
– Love Buddha
Nov 15 '18 at 15:57
It sounds like you'd be better off writing a desktop application for your purposes.
– phuzi
Nov 15 '18 at 16:13
you could possibly use an alternative mechanism like localStorage within the browser. But it will only end up being uploaded to the server if the user actually opens the same page again while connected to the net...and you might still have issues with things like CORS if it's not running in a proper http environment. You'd be better off with a proper thick-client app (i.e. desktop application) and maybe a background service to do the syncing
– ADyson
Nov 15 '18 at 16:15
|
show 4 more comments
I have a requirement which i need some input on, I am using a very outdated version of xojo for a legacy application, the requirement is i need to open a webpage on the users system which isn't connected to the internet!
So i have a folder containing a website on its entirety, when i open the index.html file it loads all the resources locally and does not require anything to be download or access the internet.
Now on this website the user performs some actions like a survey or a guide as an example and i need to record all these actions and store it on a file so that later when the user is connected to the internet i can upload the files to the server.
How can i write json data to a file on the users pc via IE/Chrome/Firefox/Safari using javascript? Any ideas will be helpful.
javascript jquery html json xojo
I have a requirement which i need some input on, I am using a very outdated version of xojo for a legacy application, the requirement is i need to open a webpage on the users system which isn't connected to the internet!
So i have a folder containing a website on its entirety, when i open the index.html file it loads all the resources locally and does not require anything to be download or access the internet.
Now on this website the user performs some actions like a survey or a guide as an example and i need to record all these actions and store it on a file so that later when the user is connected to the internet i can upload the files to the server.
How can i write json data to a file on the users pc via IE/Chrome/Firefox/Safari using javascript? Any ideas will be helpful.
javascript jquery html json xojo
javascript jquery html json xojo
asked Nov 15 '18 at 15:09
The Confused CoderThe Confused Coder
98112
98112
closed as too broad by phuzi, cнŝdk, ADyson, Graham, atline Nov 16 '18 at 3:31
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as too broad by phuzi, cнŝdk, ADyson, Graham, atline Nov 16 '18 at 3:31
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Is there a reason they're not online, or is it just poor connectivity? There's typically no way to write a file to the file system directly from a browser (it's a bit of a security risk) without prompting them to download a file.
– phuzi
Nov 15 '18 at 15:11
There is, they use this legacy application in a no internet environment at certain client locations, is there a way to write to a already existing file in the local folder where the html file is located?
– The Confused Coder
Nov 15 '18 at 15:43
Creating files and saving it in storage is a server side act. Your application is similar to browser itself. So it can not be done directly. You have to access server side resources of that device.
– Love Buddha
Nov 15 '18 at 15:57
It sounds like you'd be better off writing a desktop application for your purposes.
– phuzi
Nov 15 '18 at 16:13
you could possibly use an alternative mechanism like localStorage within the browser. But it will only end up being uploaded to the server if the user actually opens the same page again while connected to the net...and you might still have issues with things like CORS if it's not running in a proper http environment. You'd be better off with a proper thick-client app (i.e. desktop application) and maybe a background service to do the syncing
– ADyson
Nov 15 '18 at 16:15
|
show 4 more comments
Is there a reason they're not online, or is it just poor connectivity? There's typically no way to write a file to the file system directly from a browser (it's a bit of a security risk) without prompting them to download a file.
– phuzi
Nov 15 '18 at 15:11
There is, they use this legacy application in a no internet environment at certain client locations, is there a way to write to a already existing file in the local folder where the html file is located?
– The Confused Coder
Nov 15 '18 at 15:43
Creating files and saving it in storage is a server side act. Your application is similar to browser itself. So it can not be done directly. You have to access server side resources of that device.
– Love Buddha
Nov 15 '18 at 15:57
It sounds like you'd be better off writing a desktop application for your purposes.
– phuzi
Nov 15 '18 at 16:13
you could possibly use an alternative mechanism like localStorage within the browser. But it will only end up being uploaded to the server if the user actually opens the same page again while connected to the net...and you might still have issues with things like CORS if it's not running in a proper http environment. You'd be better off with a proper thick-client app (i.e. desktop application) and maybe a background service to do the syncing
– ADyson
Nov 15 '18 at 16:15
Is there a reason they're not online, or is it just poor connectivity? There's typically no way to write a file to the file system directly from a browser (it's a bit of a security risk) without prompting them to download a file.
– phuzi
Nov 15 '18 at 15:11
Is there a reason they're not online, or is it just poor connectivity? There's typically no way to write a file to the file system directly from a browser (it's a bit of a security risk) without prompting them to download a file.
– phuzi
Nov 15 '18 at 15:11
There is, they use this legacy application in a no internet environment at certain client locations, is there a way to write to a already existing file in the local folder where the html file is located?
– The Confused Coder
Nov 15 '18 at 15:43
There is, they use this legacy application in a no internet environment at certain client locations, is there a way to write to a already existing file in the local folder where the html file is located?
– The Confused Coder
Nov 15 '18 at 15:43
Creating files and saving it in storage is a server side act. Your application is similar to browser itself. So it can not be done directly. You have to access server side resources of that device.
– Love Buddha
Nov 15 '18 at 15:57
Creating files and saving it in storage is a server side act. Your application is similar to browser itself. So it can not be done directly. You have to access server side resources of that device.
– Love Buddha
Nov 15 '18 at 15:57
It sounds like you'd be better off writing a desktop application for your purposes.
– phuzi
Nov 15 '18 at 16:13
It sounds like you'd be better off writing a desktop application for your purposes.
– phuzi
Nov 15 '18 at 16:13
you could possibly use an alternative mechanism like localStorage within the browser. But it will only end up being uploaded to the server if the user actually opens the same page again while connected to the net...and you might still have issues with things like CORS if it's not running in a proper http environment. You'd be better off with a proper thick-client app (i.e. desktop application) and maybe a background service to do the syncing
– ADyson
Nov 15 '18 at 16:15
you could possibly use an alternative mechanism like localStorage within the browser. But it will only end up being uploaded to the server if the user actually opens the same page again while connected to the net...and you might still have issues with things like CORS if it's not running in a proper http environment. You'd be better off with a proper thick-client app (i.e. desktop application) and maybe a background service to do the syncing
– ADyson
Nov 15 '18 at 16:15
|
show 4 more comments
1 Answer
1
active
oldest
votes
You can only emulate a download, direct writing to local disk is not allowed.
See this post for possible answer:
Download JSON object as a file from browser
So what your saying is i can use js to create a json object and have that downloaded to disk? will it require the user to manually save it to a location? or can i specify the location to where the file has to be saved?
– The Confused Coder
Nov 15 '18 at 15:46
User will have to manually save it. Actually i just remembered my cousin had a similar case to yours, mentioned an issue where reading in files from local disk is not allowed either when running an html file out of a directory directly. He created an SPA using Spring Framework as a service the user could run locally. spring.io
– Marc Newton
Nov 15 '18 at 15:56
I think he used Spring Boot spring.io/projects/spring-boot
– Marc Newton
Nov 15 '18 at 16:02
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can only emulate a download, direct writing to local disk is not allowed.
See this post for possible answer:
Download JSON object as a file from browser
So what your saying is i can use js to create a json object and have that downloaded to disk? will it require the user to manually save it to a location? or can i specify the location to where the file has to be saved?
– The Confused Coder
Nov 15 '18 at 15:46
User will have to manually save it. Actually i just remembered my cousin had a similar case to yours, mentioned an issue where reading in files from local disk is not allowed either when running an html file out of a directory directly. He created an SPA using Spring Framework as a service the user could run locally. spring.io
– Marc Newton
Nov 15 '18 at 15:56
I think he used Spring Boot spring.io/projects/spring-boot
– Marc Newton
Nov 15 '18 at 16:02
add a comment |
You can only emulate a download, direct writing to local disk is not allowed.
See this post for possible answer:
Download JSON object as a file from browser
So what your saying is i can use js to create a json object and have that downloaded to disk? will it require the user to manually save it to a location? or can i specify the location to where the file has to be saved?
– The Confused Coder
Nov 15 '18 at 15:46
User will have to manually save it. Actually i just remembered my cousin had a similar case to yours, mentioned an issue where reading in files from local disk is not allowed either when running an html file out of a directory directly. He created an SPA using Spring Framework as a service the user could run locally. spring.io
– Marc Newton
Nov 15 '18 at 15:56
I think he used Spring Boot spring.io/projects/spring-boot
– Marc Newton
Nov 15 '18 at 16:02
add a comment |
You can only emulate a download, direct writing to local disk is not allowed.
See this post for possible answer:
Download JSON object as a file from browser
You can only emulate a download, direct writing to local disk is not allowed.
See this post for possible answer:
Download JSON object as a file from browser
answered Nov 15 '18 at 15:18
Marc NewtonMarc Newton
2,0581426
2,0581426
So what your saying is i can use js to create a json object and have that downloaded to disk? will it require the user to manually save it to a location? or can i specify the location to where the file has to be saved?
– The Confused Coder
Nov 15 '18 at 15:46
User will have to manually save it. Actually i just remembered my cousin had a similar case to yours, mentioned an issue where reading in files from local disk is not allowed either when running an html file out of a directory directly. He created an SPA using Spring Framework as a service the user could run locally. spring.io
– Marc Newton
Nov 15 '18 at 15:56
I think he used Spring Boot spring.io/projects/spring-boot
– Marc Newton
Nov 15 '18 at 16:02
add a comment |
So what your saying is i can use js to create a json object and have that downloaded to disk? will it require the user to manually save it to a location? or can i specify the location to where the file has to be saved?
– The Confused Coder
Nov 15 '18 at 15:46
User will have to manually save it. Actually i just remembered my cousin had a similar case to yours, mentioned an issue where reading in files from local disk is not allowed either when running an html file out of a directory directly. He created an SPA using Spring Framework as a service the user could run locally. spring.io
– Marc Newton
Nov 15 '18 at 15:56
I think he used Spring Boot spring.io/projects/spring-boot
– Marc Newton
Nov 15 '18 at 16:02
So what your saying is i can use js to create a json object and have that downloaded to disk? will it require the user to manually save it to a location? or can i specify the location to where the file has to be saved?
– The Confused Coder
Nov 15 '18 at 15:46
So what your saying is i can use js to create a json object and have that downloaded to disk? will it require the user to manually save it to a location? or can i specify the location to where the file has to be saved?
– The Confused Coder
Nov 15 '18 at 15:46
User will have to manually save it. Actually i just remembered my cousin had a similar case to yours, mentioned an issue where reading in files from local disk is not allowed either when running an html file out of a directory directly. He created an SPA using Spring Framework as a service the user could run locally. spring.io
– Marc Newton
Nov 15 '18 at 15:56
User will have to manually save it. Actually i just remembered my cousin had a similar case to yours, mentioned an issue where reading in files from local disk is not allowed either when running an html file out of a directory directly. He created an SPA using Spring Framework as a service the user could run locally. spring.io
– Marc Newton
Nov 15 '18 at 15:56
I think he used Spring Boot spring.io/projects/spring-boot
– Marc Newton
Nov 15 '18 at 16:02
I think he used Spring Boot spring.io/projects/spring-boot
– Marc Newton
Nov 15 '18 at 16:02
add a comment |
Is there a reason they're not online, or is it just poor connectivity? There's typically no way to write a file to the file system directly from a browser (it's a bit of a security risk) without prompting them to download a file.
– phuzi
Nov 15 '18 at 15:11
There is, they use this legacy application in a no internet environment at certain client locations, is there a way to write to a already existing file in the local folder where the html file is located?
– The Confused Coder
Nov 15 '18 at 15:43
Creating files and saving it in storage is a server side act. Your application is similar to browser itself. So it can not be done directly. You have to access server side resources of that device.
– Love Buddha
Nov 15 '18 at 15:57
It sounds like you'd be better off writing a desktop application for your purposes.
– phuzi
Nov 15 '18 at 16:13
you could possibly use an alternative mechanism like localStorage within the browser. But it will only end up being uploaded to the server if the user actually opens the same page again while connected to the net...and you might still have issues with things like CORS if it's not running in a proper http environment. You'd be better off with a proper thick-client app (i.e. desktop application) and maybe a background service to do the syncing
– ADyson
Nov 15 '18 at 16:15