Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Filter file type in FileUpload control

Filter file type in FileUpload control

Scheduled Pinned Locked Moved ASP.NET
csharpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Elena2006
    wrote on last edited by
    #1

    Hi, Is there any way to set a property for FileUpload control to filter file type in .NET Web application? Thanks in Advance.

    S N 2 Replies Last reply
    0
    • E Elena2006

      Hi, Is there any way to set a property for FileUpload control to filter file type in .NET Web application? Thanks in Advance.

      S Offline
      S Offline
      sashidhar
      wrote on last edited by
      #2

      Use Regular Expression Validator ..!E

      //Example for PDF Files..!
      ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.pdf)$

      MyFirstArticlePublished: MenuControlSelectedItem Why Do Some People Forget To Mark as Answer .If It Helps.

      E 1 Reply Last reply
      0
      • S sashidhar

        Use Regular Expression Validator ..!E

        //Example for PDF Files..!
        ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.pdf)$

        MyFirstArticlePublished: MenuControlSelectedItem Why Do Some People Forget To Mark as Answer .If It Helps.

        E Offline
        E Offline
        Elena2006
        wrote on last edited by
        #3

        how to filter the file directly into the merge window

        S 1 Reply Last reply
        0
        • E Elena2006

          how to filter the file directly into the merge window

          S Offline
          S Offline
          sashidhar
          wrote on last edited by
          #4

          Use this Link..! http://aspdotnetcodebook.blogspot.com/2008/12/how-to-use-regularexpressionvalidator.html[^]

          MyFirstArticlePublished: MenuControlSelectedItem Why Do Some People Forget To Mark as Answer .If It Helps.

          1 Reply Last reply
          0
          • E Elena2006

            Hi, Is there any way to set a property for FileUpload control to filter file type in .NET Web application? Thanks in Advance.

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #5

            No. Your best bet is to validate the file type on server before you save it.

            Navaneeth How to use google | Ask smart questions

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups