amitye
12-10-2009, 05:35 AM
Hi,
I am trying to make an xml file download from my website, so the saveAs window will be open, I checked the forum and found the following code. but instead of saving the xml file it saves the html file. any clue???
are there other ways to do it ?
<html>
<script type="text/javascript">
function forceSaveAs (filename){
document.execCommand('SaveAs',null,filename)
}
</script>
<a href='/DVEConfiguration.xml' onclick=\"forceSaveAs('DVEConfiguration.xml_export'); return false\">Download</a>
</html>
I also try to send the xml with the following header but with no success
print "Content-type: application/octet-stream\n\n";
print "Content-Disposition: attachment; filename=file.xml;"
I am trying to make an xml file download from my website, so the saveAs window will be open, I checked the forum and found the following code. but instead of saving the xml file it saves the html file. any clue???
are there other ways to do it ?
<html>
<script type="text/javascript">
function forceSaveAs (filename){
document.execCommand('SaveAs',null,filename)
}
</script>
<a href='/DVEConfiguration.xml' onclick=\"forceSaveAs('DVEConfiguration.xml_export'); return false\">Download</a>
</html>
I also try to send the xml with the following header but with no success
print "Content-type: application/octet-stream\n\n";
print "Content-Disposition: attachment; filename=file.xml;"