Regular Expression

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.
 
J

Jesse Houwing

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.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top