Server side exception : failed to image_name.jpg

Last post 11-22-2010, 1:10 PM by Eric. 1 replies.
Sort Posts: Previous Next
  •  11-22-2010, 8:55 AM 65113

    Server side exception : failed to image_name.jpg

    Hi all,
     
    I have a problem with CuteEditor when trying to uploading images. I have ip licence.
     
    I have a control panel with its own login system cookies/mySql/php programmed.
     
    To run CuteEditor inside my control panel I did these changes:
     
    1) in the main file  include_CuteEditor.php at the beginning I inserted this code instead of standard
     
    <?php
    /*
    error_reporting(E_ALL ^ E_NOTICE);
    if(!isset($_SESSION)) session_start();
    */

    $Dir_Root = $_SERVER['DOCUMENT_ROOT'];
    require_once($Dir_Root . '/cp/include/costanti.php');
    require_once($Dir_Root . '/cp/include/errors.php');
    require_once($Dir_Root . '/cp/include/utils.php');
    require_once($Dir_Root . '/cp/include/db_manager.php');
    require_once($Dir_Root . '/cp/include/session.php');
    require_once($Dir_Root . '/cp/include/user_info.php');
    require_once($Dir_Root . '/cp/include/user_manager.php');
        
    $user_manager = new UserManager();
    $logged = $user_manager->SessionLoggedIn();
    if (!$logged)
    {
    header("location: " . URL);
    }
    error_reporting(E_ALL ^ E_NOTICE);  
     
    2) I did the same thing in the file "Dialogs/Include_Security.php" 
     
    3) I change also the beginning of the file "Dialogs/phpuploader/include_phpuploader.php"  in the following way:
     
     <?php
    $Dir_Root = $_SERVER['DOCUMENT_ROOT'];
    require_once($Dir_Root . '/cp/include/costanti.php');
    require_once($Dir_Root . '/cp/include/errors.php');
    require_once($Dir_Root . '/cp/include/utils.php');
    require_once($Dir_Root . '/cp/include/db_manager.php');
    require_once($Dir_Root . '/cp/include/session.php');
    require_once($Dir_Root . '/cp/include/user_info.php');
    require_once($Dir_Root . '/cp/include/user_manager.php');
        
    $user_manager = new UserManager();
    $logged = $user_manager->SessionLoggedIn();
    if (!$logged)
    {
    header("location: " . URL);
    }

    error_reporting(E_ALL ^ E_NOTICE);

    /*
    if(@$_GET["ContextValue"])
    {
    if(!@$_SESSION)
    {
    session_id(@$_GET["ContextValue"]);
    }
    else
    {
    echo("Session has started already, unable to set the session id! Please include uploader before session_start().");
    exit(200);
    }
    }
    */
     
    4) I have created "Uploads" folder in the root and open writing access
     
    5) I have created "dialogs/phpuploader/uploadertemp/" folder under cute editor main folder and open it to writing access
     
     
    With these modifications I can use all CuteEditor functionalities behind my control panel on the domain cippato.eu.
    The problem is that on the same server (same ip)  I have  added domain bosellostufe.it and uploaded the same modified cuteeditor...all params are equal for my control panel, but in this case I can not upload images.
    Without my modifications cute editor open upload popups but tell me that it can not go on for session problems.
     
    Please, can you help me?
     
    PS: if you like I can give you an access to control panel both on cippato.eu and bosellostufe.it so you can see that one runs well and the other none. 
     
     Thank you,
    Lorenzo 
     
  •  11-22-2010, 1:10 PM 65118 in reply to 65113

    Re: Server side exception : failed to image_name.jpg

    Dear Lorenzo,
     
    Temporary directory setting:
     
     1. Open cuteeditor_files\Dialogs\phpuploader\include_phpuploader.php
       
        Search the following function in this file:
       
        function _InternalGetFile($guid,$checkValidated)
        {
           $dir = $this->InternalGetTempDirectory();
           //***************************************//
           $dir="/home/wwwbeau/public_html/ce6.7/eric1"; //add this line, please change this path to actual one  
           //***************************************//
           $arr=PhpUploader_GetFiles(__FILE__,__LINE__,"$dir/*." . $guid . ".*");
           if($arr==null||count($arr)==0)
               return null;
           if( $checkValidated && substr(PhpUploader_GetBaseName($arr[0]),0,10)!="persisted.")
               throw(new Exception("This file can not be validated!"));
           $mvcfile=new PhpUploadFile();
           $mvcfile->FileGuid=$guid;
           $mvcfile->FilePath=str_replace("\\","/",$arr[0]);
           $mvcfile->FileSize=filesize($arr[0]);
           $mvcfile->FileName=substr(PhpUploader_GetBaseName($arr[0]),47,-5);//also remove suffix ".resx"
           return $mvcfile;
        }    
         add the following line to this function:
         $dir="/home/wwwbeau/public_html/ce6.7/eric1"; //add this line, please change this path to actual one  

    2. Open file “\cuteeditor_files\Dialogs\upload.php”, locate the following line:

    <?php
               $uploader=new PhpUploader();
               $uploader->Name="UploadControl";
                        
               $uploader->MultipleFilesUpload=true;
               $uploader->LicenseUrl="upload.php?loadlic=1";
               if($Filter)
                  $uploader->AllowedFileExtensions=str_replace(".","",$Filter);
               if($C_MaxSize)
                  $uploader->MaxSizeKB=$C_MaxSize;
                //***************************************//
               $uploader->TempDirectory="/home/wwwbeau/public_html/ce6.7/eric1";
                //***************************************//
              
               $uploader->Render();
               ?>           
      //add the following code to this function, please update path to your actual one        
        $uploader->TempDirectory="/home/wwwbeau/public_html/ce6.7/eric1"; 

    After set the temporary directory, if your issue is still existing, please send cuteeditor for php access url and ftp access to eric@cutesoft.net, I will check this issue for you.
     
    Thank you for your business
View as RSS news feed in XML