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. validate the extension of the uploaded file

validate the extension of the uploaded file

Scheduled Pinned Locked Moved ASP.NET
regex
6 Posts 4 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.
  • R Offline
    R Offline
    RajaAhmed
    wrote on last edited by
    #1

    i m looking for regex that validate the extension of the uploaded file

    C V P 3 Replies Last reply
    0
    • R RajaAhmed

      i m looking for regex that validate the extension of the uploaded file

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Excellent. I suggest you download Expresso, and use that to build your regex. I'm not sure exactly what sort of validation you want to do ( image file, file with an extension that is three letters, what ? ), so I can't really give you an answer.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      R 1 Reply Last reply
      0
      • R RajaAhmed

        i m looking for regex that validate the extension of the uploaded file

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        i once give an answer to someone with the same request. please search here on the forum

        Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

        1 Reply Last reply
        0
        • C Christian Graus

          Excellent. I suggest you download Expresso, and use that to build your regex. I'm not sure exactly what sort of validation you want to do ( image file, file with an extension that is three letters, what ? ), so I can't really give you an answer.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          R Offline
          R Offline
          RajaAhmed
          wrote on last edited by
          #4

          actually i want to just validate whether the uploaded file is a video file or not i-e .dat, .mp4,.mpegv etc

          C 1 Reply Last reply
          0
          • R RajaAhmed

            actually i want to just validate whether the uploaded file is a video file or not i-e .dat, .mp4,.mpegv etc

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Of course, a file can be a video and not have a valid extension. You can use the System.IO.Path class to get the extension and do a basic string match, just call ToLower or ToUpper to make case irrelevant.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            1 Reply Last reply
            0
            • R RajaAhmed

              i m looking for regex that validate the extension of the uploaded file

              P Offline
              P Offline
              puviyarasan j
              wrote on last edited by
              #6

              if you use the asp:fileupload control use the

              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