how to use SearchPatterns

6 posts, 2 answers
  1. VnDevil
    VnDevil avatar
    58 posts
    Member since:
    Oct 2012

    Posted 13 Nov 2010 Link to this post

    Hi Telerik,

    I'm using RadFileExplorer in this page

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server">
                <Configuration UploadPaths="/Uploads/examples" ViewPaths="/Uploads/examples" DeletePaths="/Uploads/examples"
                    MaxUploadFileSize="2097151000"
                    SearchPatterns=".jpg" />
            </telerik:RadFileExplorer>
        </div>
        </form>
    </body>
    </html>

    I set SearchPatterns: ".jpg" or "jpg" but I couldn't upload that file with extension "jpg", Please help me
  2. VnDevil
    VnDevil avatar
    58 posts
    Member since:
    Oct 2012

    Posted 15 Nov 2010 Link to this post

    anyone help me ??
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 16 Nov 2010 Link to this post

    Hi DA DA,

    To enable jpg file upload, you should set the asterisk symbol before the ".jpg" string, e.g.

    SearchPatterns="*.jpg"

    Greetings,
    Rumen
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  5. VnDevil
    VnDevil avatar
    58 posts
    Member since:
    Oct 2012

    Posted 16 Nov 2010 Link to this post

    It's working, thanks for your help ^^
  6. Nikola
    Nikola avatar
    7 posts
    Member since:
    Nov 2010

    Posted 17 Mar 2011 Link to this post

    Hi!

    I have a similar code
    <telerik:RadFileExplorer ID="rfeFileExplorer" runat="server"
                             Width="530"
                             Height="500"
                             OnClientFileOpen="OnClientFileOpen">
        <Configuration ViewPaths="~/../_Med"
                       SearchPatterns="*.jpg" />
    </telerik:RadFileExplorer>

    But I only need users to select images, not to upload or delete them! When they select a file, the path is copied to a RadTextBox (like in this Demo http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/client-sideapi/fileselectordialog/defaultcs.aspx).

    Everything works fine, except that the RadFileExplorer shows all files, and I need to show only pictures! I used SearchPatterns="*.jpg", but it doesn't work...the RadFileExplorer  shows .pdf and other files too.

    Can you help me to show only pictures in the RadFileExplorer?

    ---EDIT---
    I made it work! It was a reference problem form a RadWindow and some client side script. But now I'd like to display additional picture types, not only jpg. How can I add other picture types (like bmp or tif...) to the SearchPatterns? I think it's a string[], but can I define it in the markup?
  7. Answer
    Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 18 Mar 2011 Link to this post

    Hi Nikola,

    You can define multiple filetypes in the SearchPatterns property by separating them with commas (,), e.g.:
    <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server">
        <Configuration ViewPaths="~/ROOT" UploadPaths="~/ROOT" DeletePaths="~/ROOT" SearchPatterns="*.jpg,*.gif,*.png" />
    </telerik:RadFileExplorer>


    All the best,
    Dobromir
    the Telerik team
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017