Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2.     $callback = $_GET['CKEditorFuncNum'];
  3.     $file_name = $_FILES['upload']['name'];
  4.     $file_name_tmp = $_FILES['upload']['tmp_name'];
  5.     $file_new_name = '/var/www/ckeditortest/upload/';
  6.     $full_path = $file_new_name.$file_name;
  7.     $http_path = '/upload/'.$file_name;
  8.     $error = '';
  9.     if( move_uploaded_file($file_name_tmp, $full_path) ) {
  10.     } else {
  11.      $error = 'Some error occured please try again later';
  12.      $http_path = '';
  13.     }
  14.     echo "<script type=\"text/javascript\">window.parent.CKEDITOR.tools.callFunction(".$callback.",  \"".$http_path."\", \"".$error."\" );</script>";
  15. ?>