Re: Processing Uploaded Files with PHP

  •  01-25-2013, 1:23 PM

    Re: Processing Uploaded Files with PHP

    Hi BlackAce,

     

    First, you can refer to the document at http://phpfileuploader.com/document/

     

    To retrieving the uploaded file, save to your server, change file name Etc, please refer to http://phpfileuploader.com/document/scr/Deployment.htm step 3, it shows you how to handle the upload file store location and the file name after uploaded, so you can save the file there and generate the thumbnail.

     

    3. Retrieving uploaded file.
    1. <?php   
    2. //Gets the GUID of the file based on uploader name   
    3. $fileguid=@$_POST["myuploader"];   
    4. if($fileguid)   
    5. {   
    6.     //get the uploaded file based on GUID   
    7.     $mvcfile=$uploader->GetUploadedFile($fileguid);   
    8.     if($mvcfile)   
    9.     {   
    10.         //Gets the name of the file.   
    11.         echo($mvcfile->FileName);   
    12.         //Gets the temp file path.   
    13.         echo($mvcfile->FilePath);   
    14.         //Gets the size of the file.   
    15.         echo($mvcfile->FileSize);    
    16.            
    17.         //Copys the uploaded file to a new location.   
    18.         $mvcfile->CopyTo("/uploads");   
    19.         //Moves the uploaded file to a new location.   
    20.         $mvcfile->MoveTo("/uploads");   
    21.         //Deletes this instance.   
    22.         $mvcfile->Delete();   
    23.     }   
    24. }   
    25. ?>  
     

    To upload multiple files at a time, just need to set $uploader->MultipleFilesUpload=true; 

     

    Regards,

     

    Ken 

View Complete Thread