Re: getting list of uploaded file information ?

  •  08-29-2009, 5:01 AM

    Re: getting list of uploaded file information ?

    Hi,
     
    each uploaded file has a key (a guid XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) ,
     
    when you sepcify $uploader->Name="myuploader"; ,
     
    uploader will render as a <input type='hidden' name="myuploader" id="myuploader" />
     
    after the file uploaded , you can get the value via BLOCKED SCRIPT
     
    var hidden=document.getElementById("myuploader");
    var guidlist=hidden.value;
     
    or using server code if the form is submitted :
     
    $guidlist=$_POST["myuploader"];
     
     
    the guidlist is joined by '/'
     
    XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

     foreach(split("/",$_POST["myuploader"]) as $fileguid)
     {
        $mvcfile=$uploader->GetUploadedFile($fileguid);
    }
     
    and then , you can get the information :
    $mvcfile->FileName,$mvcfile->FilePath,$mvcfile->FileSize,$mvcfile->FileGuid
     
    the $mvcfile->FilePath will be :
     
    persisted.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.filename.ext.resx
     
    while the $mvcfile->FileName is
     
    filename.ext
     
    Regards,
    Terry
     
     
View Complete Thread