First introduce the jQuery and ajaxFileUpload plug-ins. Pay attention to the order. Needless to say, this is true for all plug-ins.
//单文件(包含单文件)异步上传 public function upload_image(){ //图片上传 $file = request()->file(input('name')); $info = $file->move(ROOT_PATH . 'public/uploads/images'); if($info) { return json_encode($info->getSaveName()); } }
The above is the detailed content of How does Thinkphp combine with ajaxFileUpload to implement asynchronous image transmission with ajax?. For more information, please follow other related articles on the PHP Chinese website!