1 // 图片上传 binary 二进制
2 public function videoAlertUpload()
3 {
4 // app.php
5 // 'FILE_BIG' => 'http://0.0.0.0:8073/', // 大容量文件服务器(视频)
6 // 'FILE_DIR' => '/mnt/dataHdd/fileServer', // 大容量文件服务器(视频)
7 // $rootPath = Env::get('root_path').'public/upload/videoAlert/';
8 $rootPath = config('FILE_DIR').'videoAlert/'; // 服务器磁盘路径
9 $webPath = config('FILE_BIG').'videoAlert/'; // 服务器对外配置路径
10 $rootPath = $rootPath.date("YmdHis",time()).'.jpg';
11 $webPath = $webPath.date("YmdHis",time()).'.jpg';
12
13 $input_handler = fopen('php://input', 'r');
14 $temp = tmpfile();
15 $realSize = stream_copy_to_stream($input_handler, $temp);
16 fclose($input_handler);
17 $out_handler = fopen($rootPath, 'w');
18 fseek($temp, 0, SEEK_SET);
19 stream_copy_to_stream($temp, $out_handler);
20 fclose($out_handler);
21 // Log::write($rootPath,'log');
22 Res::suc('ok',$webPath);
23 }