php
NicEdit Upload php file
- 관리자 2020.09.18 인기
-
- 7,729
- 0
nicURI : 'https://api.imgur.com/3/image', --> nicURI : './file.php',
-----------------------------------
[file.php]
//Check if we are getting the image
if(isset($_FILES['image'])) {
$path = "./upload/";
$file_path = pathinfo($_FILES["image"]['name']);
$file_ext = $file_path['extension'];
list($width, $height) = getimagesize($_FILES['image']['tmp_name']);
$file_upload_name = time().".".$file_ext;
$target_file = $path.$file_upload_name;
if(move_uploaded_file($_FILES['image']['tmp_name'], $target_file)) {
$data = array( "type"=> $file_ext,
"width"=> $width ,
"height"=> $height,
"name"=> "",
"link"=> $target_file);
$response = array('data' => $data, 'success' => true, "status" => 200 );
echo json_encode($response);
}
}
-----------------------------------
:: NicEdit php 파일업로드
댓글목록
등록된 댓글이 없습니다.