Re: Acces to the uploaded files

  •  03-25-2010, 4:09 AM

    Re: Acces to the uploaded files

    according to an exemple i've found in help, i've done that :
     
    1 file index.php with 
     
    <form id="form1" action="envoi_resultats.php" method="POST">    
         <?php
                                $uploader=new PhpUploader();
                                $uploader->Name="myuploader_General";
                                $uploader->MultipleFilesUpload=true;
                                $uploader->InsertText="Envoyer des résultats (Max 20Mo)";
                                $uploader->MaxSizeKB=2048000;    
                                $uploader->AllowedFileExtensions="xml,doc,xls";
                                $uploader->SaveDirectory=$REP_EXPORT;
                                $uploader->Render();
           ?>    
    </form>
     
    1 file envoi_resultats.php with
    <?php require_once "phpfileuploader/phpuploader/include_phpuploader.php" ?>    
    <?php    
    //Gets the file GUID list based on uploader name       
    $fileguidlist=@$_POST["myuploader_General"];    
    if($fileguidlist)    
    {    
        $guidlist=split("/",$fileguidlist);     
        foreach($guidlist as $fileguid)    
        {    
            //get the uploaded file based on GUID       
            $mvcfile=$uploader->GetUploadedFile($fileguid);       
            if($mvcfile)       
            {       
                 //Gets the name of the file.       
                 echo($mvcfile->FileName);       
                 //Gets the temp file path.       
                 echo($mvcfile->FilePath);       
                 //Gets the size of the file.       
                 echo($mvcfile->FileSize);        
                   
                 //Deletes this instance.       
                 $mvcfile->Delete();       
            }    
        }    
    }    
    ?>
     
    Uplaod works very well :-)
    but i have the message on my envoi_resultats.php
     
    Fatal error: Call to a member function GetUploadedFile() on a non-object in C:\Inetpub\wwwroot\Portail QuizzBox\envoi_resultats.php on line 11
     
    the line 11 is the line : 
    $mvcfile=$uploader->GetUploadedFile($fileguid);

    Any idea ?
     
     
     
     

    Geexor : The space geek
View Complete Thread