Hello, is there a way within WAB to create a .json file on the fly and save it at the widget level? The .json will be used to store graphics for users and can be updated with time. thanks!
No. Allowing client side code like JS to write to the file system without a user click and to a specific location would be a huge security risk. You can write a file and download it in most browsers (like you can see in the eDraw widget) but that you not be the same as what you are wanting.
No this would be he same type of huge security hole for hackers to use if it was available. Your option for saving things on the client side is to use local storage (HTML 5 supporting browsers) or Browser Cookies. The Bookmark widget uses local storage.
Thanks Robert. Local storage won't work for my scenario since I need to share the .json with all users using the widget. is it possible to call a GP service to create the file on the fly, pass the data, and write the data in the file?
I am not a GP person, but the way I would tackle this workflow is to develop a .Net web service that would be used to write info to a database hosted on your servers that the widget would communicate to using RESTful web service to read and write info or even easier would be to make a editable FeatureService table that stores the data and have the widget query the table and/or write new rows to it.
Thanks Robert. .Net service is not area of my expertise. I am still thinking the GP service option. So a GP service takes a json input and the underling python script is going to save the json string into the .json file. This way there won't be any editable FeatureService involved. Possible?
Like I said I am not a GP guy so I don't know.
Retrieving data ...