Jump to content

Access denied when saving XML file on IIS


madsovenielsen

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...