Having issue with supported files.

8 posts, 0 answers
  1. Darshan Sedani
    Darshan Sedani avatar
    12 posts
    Member since:
    Feb 2008

    Posted 27 Jun 2014 Link to this post

    Hello Support Team,

    I am using rad async upload control in my project.

    I have kept filtration for the images. If i am trying to browse file that filter is not working at first time.

    Attached snap and zip file for the code.


     <script type="text/javascript">
            function validationFailed(radAsyncUpload, args) {
                var erorMessage = getErrorMessage(radAsyncUpload, args);
                if (erorMessage == false) {
                    alert("The file must have the extension gif,jpeg,jpg,png");
                    return false;
                }
                return true;
            }

            function uploadFile(radUpload, arguments) {
                $('#<%=btnUploadImage.ClientID %>').click();
            }
        </script>
        <div>
            <div id="divUploadControl" style="float: left; width: 100%;">
                <telerik:RadAsyncUpload runat="server" ID="radUploadImage" EnableFileInputSkinning="true"
                    MultipleFileSelection="Disabled" MaxFileInputsCount="1" OnClientFileUploaded="uploadFile"
                    PostbackTriggers="btnUploadImage" Width="250" Localization-Select="Browse" OnClientValidationFailed="validationFailed"
                    EnableInlineProgress="false" TabIndex="3" AllowedFileExtensions="gif,jpeg,jpg,png">
                    <FileFilters>
                        <telerik:FileFilter Description="Allowed files are gif,jpeg,jpg,png" Extensions="gif,jpeg,jpg,png" />
                    </FileFilters>
                </telerik:RadAsyncUpload>
                <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
                <telerik:RadProgressArea ID="RadProgressArea1" Width="240px" runat="server" BackColor="Black"
                    Skin="WebBlue" ToolTip="Uploading">
                </telerik:RadProgressArea>
            </div>
            <input type="button" id="btnUploadImage" runat="server" style="width: 0px; font-size: 0px;
                height: 0px;" value="" onserverclick="btnUploadImage_Click" />
        </div>




  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Jun 2014 in reply to Darshan Sedani Link to this post

    Hi Darshan Sedani,

    RadAsyncUpload uses Upload Modules for different browsers. Filtering will not support in FileApi module. This is because browsers don’t provide native file filtering support.  For that you have to disable the Upload Modules  as follows.

    JavaScript:
    Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable = function () { return false; };

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Darshan Sedani
    Darshan Sedani avatar
    12 posts
    Member since:
    Feb 2008

    Posted 30 Jun 2014 in reply to Shinu Link to this post

    Thanks Shinu,

    But where to keep these lines? 

    Inside script tag anywhere?

    e.g

    <script type="text/javascript">
                Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable = function () { return false; };
     </script>
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Jun 2014 in reply to Darshan Sedani Link to this post

    Hi Darshan Sedani,

    Yes, you have to mention that in JavaScript. Please try the below sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadAsyncUpload ID="radasynupldImageFiles" runat="server" MultipleFileSelection="Automatic">
        <FileFilters>
            <telerik:FileFilter Description="Documents(jpg;png)" Extensions="jpg,png" />
        </FileFilters>
    </telerik:RadAsyncUpload>

    JavaScript:
    <script type="text/javascript">
        Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable = function () { return false; };
        Telerik.Web.UI.RadAsyncUpload.Modules.IFrame.isAvailable = function () { return false; };
    </script>

    Thanks,
    Shinu.
  6. Mayur
    Mayur avatar
    34 posts
    Member since:
    Mar 2012

    Posted 02 Jul 2014 Link to this post

    Hi,

    This script is working fine but for first time its not showing filter bar whereas i have put this script at client side pageload.I have attached png file .Plz  have a look.

    <script type="text/javascript">
        Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable = function () { return false; };
        Telerik.Web.UI.RadAsyncUpload.Modules.IFrame.isAvailable = function () { return false; };
    </script>


  7. Darshan Sedani
    Darshan Sedani avatar
    12 posts
    Member since:
    Feb 2008

    Posted 16 Sep 2014 Link to this post

    Hi Shinu,

    I tried the same thing mentioned above in your reply. But its is not working properly. You can have a look in the video file attached.

    Please suggest another way or solution if you have one.

    Thanks.
  8. Darshan Sedani
    Darshan Sedani avatar
    12 posts
    Member since:
    Feb 2008

    Posted 16 Sep 2014 Link to this post

    Hi Shinu,

    Can't upload video file. Attaching snapshot for your reference.

    Thanks
  9. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 18 Sep 2014 Link to this post

    Hello Darshan,

    The filter is applied only when Silverlight or Flash module is used which is possible only under IE9,8,7 versions.

    Regards,
    Peter Filipov
    Telerik
     

    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
UI for ASP.NET Ajax is Ready for VS 2017