args.get_fileInputField() is not working in IE

5 posts, 0 answers
  1. Ajith
    Ajith avatar
    1 posts
    Member since:
    Apr 2013

    Posted 17 Apr 2013 Link to this post

    function OnClientFileSelected(sender, args) {
        if ($telerik.isIE) {
            var input = args.get_fileInputField();
            if (sender.isExtensionValid(input.value)) {
                var img = document.createElement("img");
                var thumbnail = document.getElementById("thumbnail");
                if (img) {
           = "";
                    img.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = input.value;

        else {

            var file = args.get_fileInputField().files.item(args.get_rowIndex()); 
            if (!file) {
            else {


    function showThumbnail(file) {

        var image = document.createElement("img");
        var thumbnail = document.getElementById("thumbnail");
        image.file = file;

        var reader = new FileReader()
        reader.onload = (function (aImg) {
            return function (e) {
                aImg.src =;
        var ret = reader.readAsDataURL(file);
        var canvas = document.createElement("canvas");

        ctx = canvas.getContext("2d");
        image.onload = function () {
            ctx.drawImage(image, 100, 100);


     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <telerik:RadAsyncUpload ID="UploadImage" runat="server" 
                                AllowedFileExtensions="jpg,jpeg,png,gif" MaxFileSize="51200" 
    I am using the above code to preview the uploaded image.but it is not working in IE .
    This statement is returning null ."var input = args.get_fileInputField();"
    Please help me .
    Thanks in Advance
  2. Plamen
    Plamen avatar
    2723 posts

    Posted 18 Apr 2013 Link to this post

    Hello Ajith,

    You have to set DisablePlugins="true" property of RadAsyncUpload and of course add the following style:

    #thumbnail img {
           FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)

    Hope this will be helpful. Regards,
    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.
  3. DevCraft R3 2016 release webinar banner
  4. moegal
    moegal avatar
    272 posts
    Member since:
    Jul 2007

    Posted 15 May 2014 in reply to Plamen Link to this post

    this does not seem to be working for me.

    Any help?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 May 2014 in reply to moegal Link to this post

    Hi moegal,

    Unfortunately I couldn't replicate the issue at my end. Please have a look into the sample code snippet which works fine at my end. Please prove your full code and please mention the version of telerik.

    <telerik:RadAsyncUpload ID="RadAsyncUpload" runat="server" OnClientFileSelected="OnClientFileSelected">

    <script type="text/javascript">
        function OnClientFileSelected(sender, args) {
            var input = args.get_fileInputField();

  6. Plamen
    Plamen avatar
    2723 posts

    Posted 16 May 2014 Link to this post

    Hi ,

    Yes indeed it is returning null in cases when Silverlight or Flash plug-in is used s of you want it always to return a proper value you can set DisablePlugins property of the control to "true".

    Hope this will explain the issue. 


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top
DevCraft R3 2016 release webinar banner