' Symbol in uploaded filename - not working

J

Jon D

I have a form which enters a URL into a file field in my database:
E.G.

R:\Confidential\Controlled\Work.txt goes into field file_path_complete

However if the file name contains a ' character
E.G.
r:\confidential\jon's work.doc

Then it will not work correctly on my display page, as any text after
the ' will be ignored leaving it as r:\confidential\jon

Here is how I create a link to this document on my display page ...

Response.write "<a href='"&rsNOTES("File Path Complete")&"'>"
Response.write (rsNOTES("File Name"))

With rsNotes(File Path Complete) being the full path and filename.

Any help would be appreciated!
 
L

Lance Wynn

Try
Response.write "<a href=""" & server.HTMLEncode(rsNOTES("File Path
Complete")) & """>"

(You should use double quotes to encapsulate the value, the
server.HTMLEncode will change things like " to &quot; etc..)




I have a form which enters a URL into a file field in my database:
E.G.

R:\Confidential\Controlled\Work.txt goes into field file_path_complete

However if the file name contains a ' character
E.G.
r:\confidential\jon's work.doc

Then it will not work correctly on my display page, as any text after
the ' will be ignored leaving it as r:\confidential\jon

Here is how I create a link to this document on my display page ...

Response.write "<a href='"&rsNOTES("File Path Complete")&"'>"
Response.write (rsNOTES("File Name"))

With rsNotes(File Path Complete) being the full path and filename.

Any help would be appreciated!
 

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
474,264
Messages
2,571,065
Members
48,770
Latest member
ElysaD

Latest Threads

Top