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

File input field always null

3 Answers 93 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Sameer
Top achievements
Rank 1
Sameer asked on 11 Jul 2013, 08:56 AM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Jul 2013, 09:41 AM
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.
0
Sameer
Top achievements
Rank 1
answered on 25 Jul 2013, 11:31 AM
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?
0
Shinu
Top achievements
Rank 2
answered on 25 Jul 2013, 11:38 AM
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.
Tags
AsyncUpload
Asked by
Sameer
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Sameer
Top achievements
Rank 1
Share this question
or