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

Validate Filename on clientside

1 Answer 31 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
iomega 55
Top achievements
Rank 1
iomega 55 asked on 17 Apr 2014, 02:13 PM
Is there any way for validating the filename on clientside?

I need to upload an specific filename, so If the filename isnt the one is required the upload process must stop, avoiding the bandwith consume.

How can I do this?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 19 Apr 2014, 04:56 AM
Hi,

Please have a look into the sample code snippet to achieve your scenario.

ASPX:
<telerik:RadAsyncUpload ID="raduploadValidateFilenam" runat="server" OnClientFileUploading="ValidateFileName">
</telerik:RadAsyncUpload>

JavaScript:
<script type="text/javascript">
    function ValidateFileName(sender, args) {
        //filename to validate
        var FileName = "temporary name";
        if (args.get_fileName() != FileName)
            args.set_cancel(true);
    }
</script>

Thanks,
Shinu.
Tags
Upload (Obsolete)
Asked by
iomega 55
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or