problem with filesize check in mvc

Thread is closed for posting
2 posts, 0 answers
  1. Morten
    Morten avatar
    1 posts
    Member since:
    Jun 2010

    Posted 24 Jun 2010 Link to this post

    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?





  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 28 Jun 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top