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

Client side errors with IE8

2 Answers 23 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Jean-michel
Top achievements
Rank 1
Jean-michel asked on 01 Oct 2013, 08:12 AM
Hi,

We want to cancel uploading and remove last line if the selected file name was already uploaded.
But we have many problems with RadAsyncUpload and IE8.

This code didn't work with IE8:

 function onFileUploading(sender, args) {
    var fileName = args.get_fileName();

    if (uploadingFileNameIsValid(fileName)) {
        // code here...
    } else {
        args.set_cancel(true);
        alert('This file has been already uploaded. Please, remove the file uploaded or rename the file you want to upload.');
        
        // delete the display file name under upload control        
        var currentLiUpdatedFile = document.getElementById(sender.get_id() + 'row' + (sender._currentIndex - 1));
        currentLiUpdatedFile.parentNode.removeChild(currentLiUpdatedFile);

    }
}

The element currentLiUpdatedFile is null with IE8 unlike Firefox.

We believe that this is a problem with silverlight plugin.
So we try to use DisablePlugins="True" but in this case all uploads didn't work with this message :
Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManagerUploadData_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3ac9cbdec3-c810-4e87-846c-fb25a7c08002%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2013.1.220.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a3e3b0da6-8c39-4d10-9111-25eaee1f7355%3a16e4e7cd%3aed16cbdc%3af7645509%3a24ee1bba%3af46195d3%3a2003d0b8%3a1e771326%3aaa288e2d%3a7165f74%3a52af31a4, Ligne 7409 Caractère 1

However telerik resources are defined in web.config:

<system.web>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
    <controls>
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
    </controls>
    </pages>
    <httpHandlers>
          <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" validate="false" />
    </httpHandlers>
</system.web>
    
<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
        <add name="Telerik" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" />
    </handlers>
</system.webServer>

Regards,
Jean-Michel

Configuration:
Telerik.Web.UI Version : 2013.1.220.45
ASP.NET version : 4.0
Framework .NET : 4.5
OS : Windows 7 x64
IE 8 : 8.0.7601.17514

2 Answers, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 04 Oct 2013, 07:59 AM
Hi Jean-Michel,

To remove duplicated files, first get the duplicated row and simulate a remove click:

function OnClientFileUploading(sender, args) {
    var fileName = args.get_fileName();
    var uploadedFiles = sender.getUploadedFiles();
  
    for (var i = 0; i < uploadedFiles.length; i++) {
        if (uploadedFiles[i] == fileName) {
            args.set_cancel(true);
            var row = args.get_row();
            setTimeout(function() {
                    $(row).find('.ruButton, .ruCancel').click();
                }, 100);
        }
    }
}

Pay attention that this code use jQuery and you must reference it:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
    </Scripts>
</telerik:RadScriptManager>
Regards,
Hristo Valyavicharski
Telerik
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 the blog feed now.
0
Jean-michel
Top achievements
Rank 1
answered on 09 Oct 2013, 03:49 PM
You solved our problem, thank you Hristo!
Tags
AsyncUpload
Asked by
Jean-michel
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Jean-michel
Top achievements
Rank 1
Share this question
or