Re: Two questions

  •  05-08-2010, 6:05 PM

    Re: Two questions

    First of all, really like the script. Best one i found so far. 
    I used this code (below) to get the filenames, which works well...until i add a:
    $uploader->SaveDirectory="../images/upload";
    Seems it cant find the files if the path is changed...how can I fix this?
     
    You can try the following code:
    <?php require_once "phpuploader/include_phpuploader.php" ?>
    <?php session_start(); ?> 
    <html>   
    <body>   
            <form id="form1" method="POST">   
                <?php   
                    $uploader=new PhpUploader();   
                    $uploader->Name="myuploader";    
                    $uploader->Render();   
                ?>   
            </form>   
    <?php   
    //Gets the GUID of the file based on uploader name   
    $fileguid=@$_POST["myuploader"];   
    if($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);    
               
            //Copys the uploaded file to a new location.   
            $mvcfile->CopyTo("/savefiles");   
            //Moves the uploaded file to a new location.   
            //$mvcfile->MoveTo("/uploads");   
            //Deletes this instance.   
            $mvcfile->Delete();   
        }   
    }   
    ?>  
    </body>   
    </html>
     
    Issue 2, Say I only want people to upload 5 files max?
    Please use property $MaxFilesLimit, set it to 5
     
    Regards,
    Eric
     
     
     
     
View Complete Thread