Sha256: 2826e4dd02c7afaa570e598ef84e30380719a1421952fb108cb61e51847b9487

Contents?: true

Size: 1.45 KB

Versions: 24

Compression:

Stored size: 1.45 KB

Contents

 <? 
    //$url = '/Users/marcos/Sites/rails_app/ciaathletica/public/uploads/my_admin/'.time()."_".$_FILES['upload']['name'];
    $file_name = time()."_".$_FILES['upload']['name'];
    $url = __DIR__.'/../../../uploads/my_admin/'.$file_name;
    
 //extensive suitability check before doing anything with the file...
    if (($_FILES['upload'] == "none") OR (empty($_FILES['upload']['name'])) )
    {
       $message = "No file uploaded.";
    }
    else if ($_FILES['upload']["size"] == 0)
    {
       $message = "The file is of zero length.";
    }
    else if (($_FILES['upload']["type"] != "image/pjpeg") AND ($_FILES['upload']["type"] != "image/jpeg") AND ($_FILES['upload']["type"] != "image/png"))
    {
       $message = "The image must be in either JPG or PNG format. Please upload a JPG or PNG instead.";
    }
    else if (!is_uploaded_file($_FILES['upload']["tmp_name"]))
    {
       $message = "You may be attempting to hack our server. We're on to you; expect a knock on the door sometime soon.";
    }
    else {
      $message = "";
      $move = @ move_uploaded_file($_FILES['upload']['tmp_name'], $url);
      if(!$move)
      {
         $message = "Error moving uploaded file. Check the script is granted Read/Write/Modify permissions.".$url;
      }
      $url = "/uploads/my_admin/" . $file_name;
    }
 
$funcNum = $_GET['CKEditorFuncNum'] ;
echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($funcNum, '$url', '$message');</script>";
?>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
my_admin-0.1.13 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.12 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.11 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.10 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.9 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.8 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.7 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.6 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.5 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.4 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.3 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.2 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.1.1 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.0.12 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.0.11 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.0.10 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.0.9 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.0.8 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.0.7 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php
my_admin-0.0.6 lib/generators/my_admin/install/templates/public/plugins/ckeditor/ckupload.php