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!
Alex,
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.
thanks Robert for your response. Does dojo or javascript allow to write to an existing .json file on the web application? I looked at the dojo/request/xhr but haven't test it yet.
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?
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.
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.