0

My code looks like this:

 <asp:Label ID="importLabel" runat="server" Text="Update Prices" CssClass="fieldlabel" />
                <asp:FileUpload ID="importFileUpload" runat="server" />

I need to add a required field validator to only accept .csv files. How would I do this?

Thanks!

Al Woods
  • 113
  • 1
  • 3
  • 11
  • 1
    [ASP.NET - Limit file upload available file types](http://stackoverflow.com/questions/8491257/asp-net-limit-file-upload-available-file-types) – j.f. Jul 07 '14 at 18:56
  • Thank you sir! I'll update to show what was done! – Al Woods Jul 07 '14 at 18:56

1 Answers1

0
<asp:RegularExpressionValidator ID="uplValidator" runat="server" ControlToValidate="importFileUpload" ErrorMessage="Only .csv files are allowed" 
                            ValidationExpression="(.+\.([Cc][Ss][Vv]))" />

Added this REV to get it to work!

Al Woods
  • 113
  • 1
  • 3
  • 11