NicEdit Upload php file
페이지 정보
작성자 관리자 작성일 20-09-18 09:47 조회 6,680 댓글 0본문
Version 0.9 r25
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 파일업로드
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 파일업로드
댓글목록 0
등록된 댓글이 없습니다.