madsovenielsen Posted July 26, 2010 Share Posted July 26, 2010 Hey.I am using this JavaScript to make a XML file <script type="text/javascript"> var xmlDocument = new ActiveXObject('Msxml2.DOMDocument.3.0'); var gallery = xmlDocument.createElement('gallery'); var image = xmlDocument.createElement('image'); image.setAttribute('path', 'images/calliandra.jpg'); gallery.appendChild(image); xmlDocument.appendChild(gallery); xmlDocument.save('file.xml');</script> I am getting permission denied, does this have something to do with IIS ? or is it the script ?/mads Link to comment Share on other sites More sharing options...
justsomeguy Posted July 26, 2010 Share Posted July 26, 2010 Javascript doesn't have permission to save files to disk. You may need to change browser settings to allow it to do that if you want to get it to work in your browser. Link to comment Share on other sites More sharing options...
madsovenielsen Posted July 26, 2010 Author Share Posted July 26, 2010 Javascript doesn't have permission to save files to disk. You may need to change browser settings to allow it to do that if you want to get it to work in your browser.Why is it even possible to do that in JavaScript then ?Is it in any way possible to make a XML file with JavaScript ? Link to comment Share on other sites More sharing options...
justsomeguy Posted July 26, 2010 Share Posted July 26, 2010 It's only possible to have Javascript save files locally with certain browsers if you change the default security settings. No browser allows Javascript to save arbitrary files to the local disk by default. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.