Hi!
I want in ASP generate urls on a web page that point to locally stored files, like a file browser. I build the paths in visual basic code on the server.
The problem is that files with a space in them refuses to encode correctly.
I generate the code like this:
With the above code the url (when right click in IE and select properties) looks fine but the %20 has been replaced with %2520. I understand that something is trying to encode the % character.
When I skip the Replace call and do something like this for a file with name "first text.txt":
I get an url like file://mypath\myfolder\first
here this "something" that encodes the % doesn't care about the spaces.
Filename above is a string from the "scripting.filesystemobject" library.
Basically, I want to write an url that points to a file on the local network. I know there are much better ways to do this, but this is a really old asp app, and this is a small new feature that was requested. And I have everything working except this rendering of the actual urls. For folders, the Replace(folder, " ", "%20") works fine for some reason.
HELP!
/Henrik
I want in ASP generate urls on a web page that point to locally stored files, like a file browser. I build the paths in visual basic code on the server.
The problem is that files with a space in them refuses to encode correctly.
I generate the code like this:
Code:
<td><a href=<%= Replace("file://" + path + "\" + Filename, " ", "%20") %>><%= Filename %></a></td>When I skip the Replace call and do something like this for a file with name "first text.txt":
Code:
<td><a href=<%= "file://" + path + "\" + Filename %>><%= Filename %></a></td>I get an url like file://mypath\myfolder\first
here this "something" that encodes the % doesn't care about the spaces.
Filename above is a string from the "scripting.filesystemobject" library.
Basically, I want to write an url that points to a file on the local network. I know there are much better ways to do this, but this is a really old asp app, and this is a small new feature that was requested. And I have everything working except this rendering of the actual urls. For folders, the Replace(folder, " ", "%20") works fine for some reason.
HELP!
/Henrik