Regular Expression

  • Thread starter Thread starter satpo
  • Start date Start date
S

satpo

I have a file upload control in which I want to allow only pdf files.
I am using the following validation expression
"^((^$)|((([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.pdf|.PDF)$))". It
works fine except when there is a server side validation fails and the
page returns with error, my file upload regular expression error
message also popsup.
Any suggestions would help.
 
Hello satpo,
I have a file upload control in which I want to allow only pdf files.
I am using the following validation expression
"^((^$)|((([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.pdf|.PDF)$))". It
works fine except when there is a server side validation fails and the
page returns with error, my file upload regular expression error
message also popsup.
Any suggestions would help.

The server doesn't receive the full file path of the file, just the filename.
It would be a security risk to the client otherwise. If you were uploading
things from their special secret file stash on soem server, you would get
to know where that server would be, which share and more. So that is why
only the filename is transferred to the server, an dthat is of course why
your expression fails.
 
Back
Top