Accept image

2 posts, 0 answers
  1. Stein
    Stein avatar
    25 posts
    Member since:
    Apr 2008

    Posted 26 Jun 2015 Link to this post

    Is it possible to make AsyncUpload add the necessary properties to <input file>-tag, ref: http://www.w3schools.com/tags/att_input_accept.asp

    , so that this will be the rendered html: <input type="file" tabindex="0" class="ruFileInput" name="radasyncUpload_1file0" id="radasyncUpload_1file0" size="23" accept="image/*"> 

    When uploading from a smartphone it would be better to go directly to the Gallery.

  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 30 Jun 2015 Link to this post

    Hi Stein,

    Try to add this attribute with jQuery:
    function pageLoad() {
        c = $find("");
        $('.ruFileInput').attr('accept', 'image/*');
    }
    <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
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top