Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My scene: I have a asp:fileupload control that users can upload supporting documentation with during a form. It gets uploaded with a proper UNC path such as \\fileserver\shared drive\department shared\development\this-is-the-filename.pdf. It gets displayed later using that very same path within an html hyperlink, so it should theoretically open up from the browser.

The problem: is that there's sometimes spaces in the file name (I've set up a regex replace for that part though) and spaces in the folder structure in the UNC path. That's a lot harder to change. Actually, I can't change that at all.

The question: What would be the best way to handle the path? Right now every space gets replaced with a %20 which makes the path invalid and thus no file is displayed.

Thanks!
Posted
Comments
[no name] 23-Sep-14 19:29pm    
http://msdn.microsoft.com/en-us/library/hwzhtkke(v=vs.110).aspx
dfarr1 24-Sep-14 13:01pm    
This looks like the right thing, but there's not much explanation on the page... anywhere this might be discussed further or have broader example code?
ZurdoDev 24-Sep-14 8:13am    
%20 is valid because that is the code in URLs for a space.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900