Issue with Uploading files in IE

2 posts, 0 answers
  1. mohmedsadiq modan
    mohmedsadiq modan avatar
    26 posts
    Member since:
    May 2010

    Posted 21 Jun 2012 Link to this post

    Hello,

    I have added Async file upload control in page and set display as none. like
    <telerik:RadAsyncUpload ID="fuImport" runat="server" HttpHandlerUrl="~/CustomHandler.ashx"
             OnClientFileUploaded="onClientFileUploaded"  PersistConfiguration="true"
             MaxFileInputsCount="1"
             MultipleFileSelection="Disabled" OnClientFileSelected="CheckExtension"
             CssClass="jImport" OnClientAdded="onClientAdded" Style="display: none">
    </telerik:RadAsyncUpload>
    I have disabled embeded scripts in web.config
    <add key="Telerik.EnableEmbeddedScripts" value="false"/>
    for this I Have used custom handler HttpHandlerUrl="~/CustomHandler.ashx".

    Now I have opened file dialog from menu client click(ImportData()  function ) instead of clicking on select button of file upload. Script are as below.
    var $fileInput;
    function onClientAdded(sender, args) {               
        if (sender.get_id() != undefined && sender.get_id() == 'fuImport') {                   
            //get file control instance from telerik upload control.
            $fileInput = $(".jImport").find(".ruFileInput");                   
     
        }
    }
     
    //check selected file is valid or not.
    function CheckExtension(radUpload, eventArgs) {
        var input = eventArgs.get_fileInputField();               
        var fileExtension = input.value.substr(input.value.length - 3, 3);
        if (fileExtension != "xml") {
            alert(input.value + " does not have a valid extension.");
            radUpload.deleteFileInputAt(0);           
        }               
    }
     
    function ImportData()
    {
        if ($fileInput != null) {
            //open dialog box for file selection.
            $fileInput.click();
        }  
    }
    function onClientFileUploaded(sender, args) {
        //check file is uploaded properly then perform import process.
        if (sender.getUploadedFiles().length > 0) {
            $(".jImport").css('display', 'none');
            $('.jImportButton').click();
        }
    }
    Now when we call ImportData function then file dialog is opened to select the file, after selecting file, upload process is not processing file for upload in IE, when I see this in IE Developer tool Network tab it's below url is executed multiple time
    http://localhost/enigma/Telerik.RadUploadProgressHandler.ashx?AsyncProgress=true&RadUrid=3177d972-edfc-4992-aeee-1a1bbc50cdc50&_=1340265308915
    RadUrid
    changed in every request.

    If I test same in FF and Chrome then it's worked perfect. Also If I set Display : block to file upload control and then upload files clicking on select button of file upload in IE then it's worked perfect.

    Note : My site is hosted in Shared hosting server so I am not able to add handler in web.config.

    Kindly Help me to resolve this issue.

    Thanks in Advance.
    Mohmedsadiq Modan
  2. Bozhidar
    Admin
    Bozhidar avatar
    1188 posts

    Posted 25 Jun 2012 Link to this post

    Hi,

    This is a known limitation of IE. You can read more about this in the following forum topic:
    http://www.telerik.com/community/forums/aspnet-ajax/async-upload/select-file-while-click.aspx 
     
    All the best,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top