0

I am trying to move a file from one directory to another using JavaScript. I have already tried the code below...

function moveFile(){
   var object = new ActiveXObject("Scripting.FileSystemObject");
   var file = object.GetFile("C:\\wamp\\www\\phptest.php");
   file.Move("C:\\wamp\\");
   document.write("File is moved successfully");
}

... which yields this error:

Uncaught ReferenceError: ActiveXObject is not defined

I'm using Chrome, which doesn't support ActiveX.

I have also tried IE-tab and enabling ActiveX features, with no success. Is there another way to move a file from one directory to another, so that it will still work using Chrome?

Thanks!

Clomp
  • 3,168
  • 2
  • 23
  • 36
  • Hi Idan! What's the link to the `IE-tab` version, which you've already tried out? Would you please create a link to that? There seem to be a couple of IE Tab links online. I wasn't sure if you had tried out this one - http://ietab.mozdev.org - or a different one. – Clomp Mar 02 '18 at 20:20
  • Hi! I have used this version: https://www.ietab.net/ . The problem is that I am using sqlite, which is not supported with IE rendering. – Idan Lazimi Mar 03 '18 at 11:12
  • Well sqlite is a database. IE Tab is switching rendering engines from Blink (with V8) to Trident. (See https://en.wikipedia.org/wiki/Web_browser_engine) You'd still need to use PHP to grab form data & insert it into that RDBMS. You may want to look into using the `webkitRequestFileSystem` in Chrome. It won't work in Firefox. There are some gotchyas with using it (such as sandboxing), but Eric Bidelman (ebidel) has done some extensive work with it: https://stackoverflow.com/questions/11676584/where-does-persistent-file-system-storage-store-with-chrome – Clomp Mar 03 '18 at 19:56

0 Answers0