checking for the file type(.txt,jpg,etc) and size before uploading
<p>i am trying to uplaod the file . before that i need  to check  for the  file type  and  size  before  saving  into the  specified  folder.
 i need   allow  user  only  upload .jpg, .bmp, .swf,.png,.tiff,
 no other  fiel  like .txt,  pdf, .doc  and   need  to check file  size  is  always less   than  1 MB. can we  do this in javascript  or c#  coding</p>

<p>2: and  before  saving the  file  i need  to  check  if  there  is any file  with a  same  name in  the  folder  if it is there   than  alret the  user telling  a  file  name  exits
and   should  rename the   file</p>

<p>any solution on this   would be  great<br />
  thank  you</p>
