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

[Solved] Problem with the Upload Control

0 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dhaval
Top achievements
Rank 2
Dhaval asked on 31 Mar 2011, 11:39 AM
Hi,

I am using upload control for MVC, the problem that i am facing is while using clientevents OnUpload. Below is the sample code that i am using:
<%   Html.Telerik().Upload().Name("uploadedfile") _
                                 .Multiple(True) _
                                 .Async(Sub(upl)
                                            upl.Save("Save", "Client") _
                                            .AutoUpload(False) _
                                            .Remove("Remove", "Client")
                                        End Sub) _
                              .ClientEvents(Function(cl) cl.OnUpload("OnUpload")) _
                   .Enable(True).Render() %>

function OnUpload(e) {
        // Array with information about the uploaded files
 
        var files = e.files;
         
        // Check the extension of each file and abort the upload if it is not .jpg
        $.each(files, function (file) {
            if (file.extension != ".jpg") {
                alert(file.extension);
                alert("Only .jpg files can be uploaded")
                e.preventDefault();
                return false;
            }
        });
    }
 
Here in OnUpload function, i am not getting file.extension(shown in bold). Also i am not getting file.size..

Please help me out with this if any one have a solution.

Regards,
Dhaval Shukla

Tags
Grid
Asked by
Dhaval
Top achievements
Rank 2
Share this question
or