본문 바로가기

php file upload

코드이그나이터 파일 업로드 $config['upload_path'] = './uploads/order/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '0'; // 서버 설정에 따라 적용 $config['max_width'] = '0'; // $config['max_height'] = '0'; // $this->load->library('upload',$config); // 이미지 1 if ( ! $this->upload->do_upload('company_license_img'))//company_license_img 업로드 파일의 name 속성{ $error = array('error' => $this->upload->display_errors()); //.. 더보기
코드이그나이터 파일 업로드 $img_file1 = ""; // 파일이름 저장 변수 $config['upload_path'] = './uploads/admin_request/'; // 업로드할 경로 지정 $config['allowed_types'] = 'gif|jpg|png'; $config['max_size']= '0'; // 0 은 서버 설정에 따라 적용 $config['max_width'] = '0'; $config['max_height'] = '0'; $this->load->library('upload',$config); // 파일업로드 라이브러리 로딩 // 이미지 1 if ( ! $this->upload->do_upload('file_add')) // file_add라는 이름으로 파일 업로드 체크 { $error = arr.. 더보기
php 파일 업로드시 파일 디렉토리 변경 php 파일 업로드시 파일 경로 이동. $title_img = $_FILES['img_file']['name']; // 파일 이름 얻어오기 // Create target dir$root_path = $_SERVER["DOCUMENT_ROOT"]; // . 경로 알아내기$targetDir = $root_path . "/files/attach/images/228/". $last_num . "/"; // 지정할 경로 if (!file_exists($targetDir)) { . // 디렉토리 생성 @mkdir($targetDir);} $uploadFile = $targetDir . basename($_FILES['img_file']['name']); // 변수에 파일경로 및 파일 이름 저장// move_uplo.. 더보기