Re: Unable to get file name of uploaded file

  •  06-25-2011, 8:04 AM

    Re: Unable to get file name of uploaded file

    Hi DBarsri,
     
    I tried the following code, those two highlighted code are commented, this example works fine on my end, the mvcfle return correct value, please check whether those highlighted code leads to your issue:
     
    <?php require_once "phpuploader/include_phpuploader.php" ?>
    <?php session_start(); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head> 
    </head>
    <body>
     <div class="demo">
       <form id="form1" method="POST">
        <?php
                               $uploader=new PhpUploader();
                               $uploader->Name="current_uploader";
                               $uploader->MultipleFilesUpload=true;
                               $uploader->InsertText="Select file(s)";                         
                               $uploader->AllowedFileExtensions="*.jpg,*.png,*.gif,*.bmp,*.txt,*.zip";
                               //$uploader->SaveDirectory="files/" . $_SESSION['orgid'];
                               $uploader->FlashUploadMode="Partial";
                               $uploader->Render();
        ?>
    <?php
    $fileguidlist=@$_POST["current_uploader"];
       if($fileguidlist)
       {
          //echo $fileguidlist;
          $guidlist=split("/",$fileguidlist);
          foreach($guidlist as $fileguid)
        {
           if($uploader)
              echo $fileguid;
         $mvcfile=$uploader->GetUploadedFile($fileguid);
         if($mvcfile)
         {     
                echo "myfile=" . $mvcfile->FileName;
                //Rename the uploaded file
                //rename("files/".$_SESSION['orgid']."/".$mvcfile->FileName,$_SESSION['curTkt']."~".$mvcfile->FileName);
             }
          }
       }
    ?> 
        <br /><br />
        <input type='submit' value="Submit Form" />    
       </form>
     </div>
    </body>
    </html>
     
    Thanks for asking
View Complete Thread