Browser Issue - Firefox 3.0.7 and 2.0.0.20 to run ASP.NET program

B

bienwell

Hi all,

I have a question on the web browser to use for the ASP.NET program. I have
a web page developped in ASP.NET program (VB language). On my page, there's
is an object:
<input id="File1" type="file" size="70" name="File1" runat="Server" />

I put this validation expression for the file upload

<asp:regularexpressionvalidator id="RegularExpressionValidator3"
runat="server" ForeColor="LightCoral"
ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))*\\(\w{2}|\w{3})_(A|a)(B|b)(C|c)\d{4}_\d{2}_\d{2}(.csv|.CSV|.Csv|.txt|.Txt|.TXT)$"
ErrorMessage="You must specify the file location and the filename
must follow this convention: CC(C)_ABCyyyy_mm_dd.csv"
ControlToValidate="File1"></asp:regularexpressionvalidator>

With IE and Firefox browser 2.0.0.20, there's no problem when users select
the correct path and the file name, and the application allows users to
upload the file.

With Firefox browser 3.0.7, users receive the error message "You must
specify the file location and the filename must follow this convention:
CC(C)_ABCyyyy_mm_dd.csv" , no matter they select the correct file, and the
users could not upload data file.

Does the Firefox browser 3.0.7 understand the Script I put on the
regularexpressionvalidator? Is there any wrong with my ValidationExpression?
What should I do to make it work in any versions of Firefox ?

Please help!

Thanks in advance.
 
B

bruce barker

most browsers will not include the file path for security reasons. not
sure why this has not been fixed in IE.

-- bruce (sqlwork.com)
 
A

Andrew Morton

FF3, Opera and IE8RC1 only make the file name, i.e. not including the path,
available so you'll need to adjust the validator's expression.

Safari on OSX and Google Chrome (versions current today) do make the path
available.

As long as the file name follows your required format, who cares where it
comes from? If they point to an invalid path they won't be able to upload it
anyway. And your validator won't work for files from a Mac.

If you have any spare Windows licences available, you could set yourself up
a few Virtual PCs for testing.

This is all you need to check:

<html><head><title>test</title></head>
<body>
<form action="#">
<input id="f" type="file">
<input type="button" onclick="alert(document.getElementById('f').value);"
value="see">
</form>
</body>
</html>

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top