简体   繁体   中英

Javascript equivalet of php move_uploaded_file

只想知道是否存在与PHP的move_uploaded_file函数等效的Java脚本代码?

No, javascript does not have the ability to have files uploaded to it or to move them around on a disk.

Javascript is sandboxed, meaning that it cant do anything outside of its running context.

This is for obvious security reasons... mainly the risk that a malicious site would upload some sort of virus or other malware to your device and then move it somewhere on your device using pure javascript...

This would be bad.

You need a server for file upload, the only thing you can do in javascript is an Ajax upload.

For example something like https://blueimp.github.io/jQuery-File-Upload/

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