php

2020.09.18 09:47

NicEdit Upload php file

  • 관리자 2020.09.18 인기
  • 7,729
    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 파일업로드
  • 공유링크 복사
  • 이전글strpos2020.09.18
  • 다음글쿠키2020.09.18
  • 댓글목록

    등록된 댓글이 없습니다.