Re: Can we set file extension and MaxsizeKb using javascript?

  •  02-23-2009, 10:21 AM

    Re: Can we set file extension and MaxsizeKb using javascript?

    Yogesh,
     
    Please check this sample code :
     
     <script type="text/javascript">
     function CuteWebUI_AjaxUploader_OnSelect(files)
     {
      for(var i=0;i<files.length;i++)
      {
       var file=files[ i ];
       if(file.FileSize!=-1)
       {
        if(file.FileSize>102400)
        {
         alert(file.FileName+" is larger then 100K");
         return false;
        }
       }
      }
     }
     </script>
     
    This is a client validation and you should validate the file size again at server side event.
     
    Regards,
    Terry
View Complete Thread