Re: Get name of the file but no upload the file

  •  10-24-2012, 7:41 AM

    Re: Get name of the file but no upload the file

    Hi jaubrun,

     

    You can achieve it in API "CuteWebUI_AjaxUploader_OnSelect". like the example below, it will alert the upload file name, then cancel the upload.

     

    1. <?php require_once "phpuploader/include_phpuploader.php" ?>  
    2. <?php session_start(); ?>  
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
    4. <html xmlns="http://www.w3.org/1999/xhtml">  
    5. <head>  
    6.     <title>  
    7.         example  
    8.     </title>  
    9. </head>  
    10. <body>  
    11.   
    12.           
    13.                 <?php                  
    14.                     $uploader=new PhpUploader();  
    15.                     $uploader->Name="myuploader";  
    16.                     $uploader->InsertText="Select multiple files (Max 10M)";  
    17.                     $uploader->MultipleFilesUpload=true;  
    18.                     $uploader->Render();  
    19.             ?>  
    20.   
    21. </body>  
    22.   
    23.  <script type='text/javascript'>  
    24.      function CuteWebUI_AjaxUploader_OnSelect(files)  
    25.      {  
    26.         for(var i=0;i<files.length;i++)  
    27.         {  
    28.             //get file name  
    29.             alert(files[i].FileName);  
    30.             //cancel the upload  
    31.             files[i].Cancel();  
    32.         }  
    33.      }  
    34.  </script>  
    35. </html>  
     

    Regards,

     

    Ken 

View Complete Thread