File input field always null

4 posts, 0 answers
  1. Sameer
    Sameer avatar
    20 posts
    Member since:
    Apr 2013

    Posted 11 Jul 2013 Link to this post

    Hi telerik,

    I am trying to access the file input in javascript onfileselected event but it is always returning a null value. args.getFileinputfield() What is the correct way to access the input field?

    Thanks,
    Sameer
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Jul 2013 Link to this post

    Hi Sameer,

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

    CSS:
    <style type="text/css">
        #thumbnail img
        {
            filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);
        }
    </style>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sameer
    Sameer avatar
    20 posts
    Member since:
    Apr 2013

    Posted 25 Jul 2013 Link to this post

    Shinu. I want to retrieve the file extension in the onclientfileselected event. There I am getting the file name but no way to get the extension. Any suggestion?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Jul 2013 Link to this post

    Hi Sameer,

    You can try the JavaScript split() to extract the extension from the file name. Please have a look into the following JavaScript code i tried which works fine as expected.

    JavaScript:
    <script type="text/javascript">
        function OnClientFileSelected(sender, args) {
            //splitting the filename and hence extracting its extension with JavaScript split method
            alert(args.get_fileName().split('.').pop());
        }
    </script>

    Thanks,
    Shinu.
Back to Top