wx.chooseMessageFile({ count: 1, type: 'file' , success(res) { wx.uploadFile({ url: 'http://xxx' , filePath: res.tempFiles[0][ 'path' ], name: 'file' , success(res) { } }) } }) |
$tmp_file = $_FILES [ 'file' ][ 'name' ]; $file_types = explode ( "." , $tmp_file ); $file_type = $file_types [ count ( $file_types ) - 1]; $savePath = ROOT_PATH . 'public' . DS . 'uploads' . DS; $str = date ( 'Ymdhis' ); $file_name = $str . "." . $file_type ; if (! copy ( $tmp_file , $savePath . $file_name )) { return '上传失败' ; } |
使用的时候 报no such file or directory
请问是什么缘故