Error when try uploading

Last post 11-23-2012, 7:01 AM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  11-22-2012, 5:26 AM 75324

    Error when try uploading

    Hello.

     

    I try use  PHP File Uploader

     

    I write:

        require_once BASE_PATH . "/library/phpuploader/include_phpuploader.php";
        $uploader=new PhpUploader();
        $uploader->Name="pdf_upload";
        $uploader->MultipleFilesUpload=true;
        $uploader->UploadUrl='/testupload.php';
        $uploader->Render();

     

     

    And in testupload.php code from FAQ:

     

    require_once "library/phpuploader/include_phpuploader.php";
    $uploader=new PhpUploader();

    $fp = fopen('upl_log.txt', 'w');

    $test = fwrite($fp, 'Go script');

          $mvcfile=$uploader->GetValidatingFile();  
     
        if($mvcfile->FileName=="accord.bmp")  
        {  
         $uploader->WriteValidationError("My custom error : Invalid file name. ");  
             exit(200);  
        }  
     
        //USER CODE:  
     
        $targetfilepath= "uploads/myprefix_" . $mvcfile->FileName;  
        if( is_file ($targetfilepath) )  
         unlink($targetfilepath);  
        $mvcfile->MoveTo( $targetfilepath );  
     
        $uploader->WriteValidationOK();

     

    when I try to load an image get the error message:

     

    Server side exception, failed to upload 228526_10150250594014978_1050049353_n.jpg
    Debug Information:
    pdf_upload : Session expired! Please refresh the page and try again.

     


    What i do wrong? How can fix this?

  •  11-22-2012, 6:32 AM 75329 in reply to 75324

    Re: Error when try uploading

    Hi,

     

    Please check the "session.save_path" of your php.ini, ensure that you have set value for this and your site has the write/read permission of the folder you set for.

     

    If you still can not fix this issue with the step above, please send me your uploader page url, I will check it and get back to you as soon as possible.

     

    [email protected]

     

    Regards,

     

    Ken

     

     

  •  11-23-2012, 4:18 AM 75337 in reply to 75329

    Re: Error when try uploading

    Thank problem was in session.


    But now page is reloaded after the download is complete and not showing file list. What's could be wrong in this time?

  •  11-23-2012, 7:01 AM 75340 in reply to 75337

    Re: Error when try uploading

    Hi mol,

     

    If you need the attachment list after uploaded. Please try example http://phpfileuploader.com/demo/ajax-attachments.php. You can use the same way to create your own attachment table.

     

    Regards,

     

    Ken 

View as RSS news feed in XML