NicEdit Upload php file > PHP

본문 바로가기

사이트 내 전체검색

뒤로가기 PHP

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 파일업로드

댓글목록 0

등록된 댓글이 없습니다.

Copyright © neion.co.kr All rights reserved.
PC 버전으로 보기