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

problem with filesize check in mvc

1 Answer 59 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 1
Morten asked on 24 Jun 2010, 08:53 AM
Hello
I'm having a problem with checking filesize in RadUpload in my mvc project. I have made the changes to get radupload working with mvc http://www.telerik.com/help/aspnet-ajax/mvc-using-upload.html  and tried this solution http://www.telerik.com/help/aspnet/upload/clientsidefilesizecheck.html but the method never gets called.

javascript function
    function checkUploadedFilesSize(progressArea, args) { 
        //progressArea.confirmed is a custom variable, 
        // you can use another if you want to 
        alert('hei'); 
        if (!progressArea.confirmed && 
       args.get_progressData().RadUpload.RequestSize > 1) { 
            if (confirm("The total size of the selected files" + 
                 " is more than the limit." + 
                 " Do you want to cancel the upload?")) { 
                progressArea.cancelRequest(); 
            } 
            else { 
                progressArea.confirmed = "confirmed"
            } 
        } 
    } 

radupload
<telerik:RadUpload ID="imageUploader" runat="server" AllowedFileExtensions=".jpg,.jpeg,.gif,.png" 
    Language="nb-NO" Localization-Add="Legg til" Localization-Clear="Fjern" Localization-Delete="Fjern" 
    Localization-Remove="Fjern" Localization-Select="Velg" ViewStateMode="Inherit" Culture="nb-NO" CssClass="userImageUpload" Skin="Vista" 
    EnableFileInputSkinning="false"
</telerik:RadUpload> 
<telerik:RadProgressArea runat="server" ID="RadProgressArea1"  OnClientProgressUpdating="checkUploadedFilesSize"/> 
<telerik:RadProgressManager runat="server" ID="RadProgressManager1"  AjaxUrl="~/Telerik.RadUploadProgressHandler.axd" /> 

Also I don't know if this has anything to do with it but looking in firebug the first call when uploading a file always fails, and the last call seems to be waiting for a response forever. Uploading files still work okay though.

Anybody knows what might be the problem?





1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 28 Jun 2010, 04:36 PM
Hello Morten,

Do you do your tests on IIS or on a local host? If IIS, which is the version that you use?  Please, paste your web.config here (excluding any passwords/usernames or connection strings) so that we can take a look at it. In fact, the point of interest is whether the RadUploadHttpModule is registered properly. The same applies to RadUploadHttpHandler. For more information on how to register properly the RadUploadHttpModule please take a look at the following link.

You need to follow the instructions for the Httphandler as well, just don't forget sufix it with axd extension instead of ashx.

Regards,
Genady Sergeev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Upload (Obsolete)
Asked by
Morten
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or