简体   繁体   中英

copy file from one folder to another folder using javascript or jquery

I have a file path like this \\\\ptrisf02\\group2\\Engine_Follow\\V2500-A5\\V2500-A5_e-Archive\\EV15159-02\\Pictures_INC\\INCOMING-LX\\Oil tank.jpg in my database. I want to copy it another folder like T:\\\\Temp\\\\ when the button clicked in my jsp page. Is there any method to do this using javascript or jquery? I tried ActiveXObject but it gives me this error Automation server can't create object in IE.

There are two main issues you are going to run into with trying to use JS in any flavour:

  1. Permissions and security.
  2. JS is sandboxed.

The better way would be to use JS to fire an Ajax call which does the file copy/move for you using whatever server side language the web server is based on. That is provided that the web server actually has the permission to do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM