0
<script>
function select(image)
{
  var str1;
  //.....
  str1 = newURL;
  var fso = ActiveXObject("Scripting.FileSystemObject");
  var abcd = fso.CreateTextFile("C:\\Desktop\\testfile.txt", true);
  abcd.WriteLine(str1);
  abcd.close();
}
</script>
<img  id= "img1" src="abc.png" alt="" onclick="select(this)"  />

i am writing this script code in my view.cshtml page. I dont know whats wrong with this code. i want this function to be execute when i select an image. is there any Assembly refernce to be added here or something? if there is browser compatibilty issue ? I have also istalled ActiveX plugin for chrome but its still not working ? so can any one suggest a better solution for this please? ?

dania
  • 87
  • 1
  • 2
  • 8
  • Have you tried `var fso = new ActiveXObject("Script.FileSystemObject");`? And what exactly isn't working? Do you see an error in the console? – Mike Cluck Nov 13 '15 at 19:04
  • @MikeC var fso = new ActiveXObject("Script.FileSystemObject"); is also not working.I want a textfile to be created at this location on selecting an image but it is not creating any file there. and it is not showing any error. – dania Nov 13 '15 at 19:16

0 Answers0