This is a migrated thread and some comments may be shown as answers.

UPLOAD FILES EXCEPT THE FILES WITH NO EXTENSION

1 Answer 55 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
beeta one
Top achievements
Rank 1
beeta one asked on 16 Oct 2012, 08:31 AM

Hii,
How to allow users to upload all files except the files with no extension?

thanks..

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Oct 2012, 08:41 AM
Hi Hash,

One suggestion is to check the uploading file's name in the OnClientFileUploading event as follows.

JS:
<script type="text/javascript">
 function OnClientFileUploading(sender, args) {
    var file = args.get_fileName();
    var extension = file.substr((file.lastIndexOf('.') + 1));
    if (extension == file) {
       args.set_cancel(true);
     }
  }
</script>

Hope this helps.

Regards,
Princy.
Tags
AsyncUpload
Asked by
beeta one
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or