Link to home
Start Free TrialLog in
Avatar of Scripter25
Scripter25

asked on

Regular Expression For uploading Doc, RTF, and Txt files

I have an upload form that needs to upload resumes. I only want to accept the following file types.

rtf, doc, txt and if possible provide a seperate error if the member trys to upload a .docx file.

The docx file is due to MS new Word 2007 I know not too many people have it now but by time I get this site completed it will be more prominate.

 

So anyhow the overall question is what would the regularexpression be for this?
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Here is a VB.NET example without using regular expressions:

Imports System.IO

...

        Dim fileName As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\Document1.doc"
        Dim info As New FileInfo(fileName)
        Dim ext As String = info.Extension.ToLower()
        If ext = "doc" OrElse ext = "rtf" OrElse ext = "txt" Then

        End If

Bob
ASKER CERTIFIED SOLUTION
Avatar of badalpatel
badalpatel

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial