Beispiel #1
0
 public function upload_course($course_id, $file_source)
 {
     $input_name = $file_source;
     $pathinfo = pathinfo($_FILES[$file_source]["tmp_name"]);
     if (!empty($_FILES[$file_source]["tmp_name"])) {
         $pathinfo = pathinfo($pathinfo['dirname']);
         //获取临时保存文件的路经
         $parent_dir_name = $pathinfo['dirname'] . "\\htdocs\\ubicom\\public\\";
         //将文件保存路径修改到public update中
         $sub_dir_name = "upload\\courses\\" . $course_id . '\\';
         $source_address = HomeController::upload_files($input_name, $parent_dir_name, $sub_dir_name);
         return $source_address;
     } else {
         return '';
     }
 }