Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a requirement where i need to send a folder path as part of webapi service URL. Suppose the folder path is D:\test\upload , i need to send this path as part of service URL: http://hostserver:52000/Service/ConfigPath/ ( D:\test\upload )

How to encode the path using javascript? and how to decode at the service side?

I tried using javascript- encodeURIComponent to encode the path and send it as part of service url So the service url now is: http://hostserver:52000/Service/ConfigPath/D%3A%5Ctest%5Cupload

When i use the about url, i get an error saying:

A potentially dangerous Request.Path value was detected from the client

Can anyone let me know how to send the folder path as part of the URL?

Thanks.
Posted
Comments
Sunasara Imdadhusen 22-Apr-14 6:38am    
Why are you trying to pass local folder path to the API? because it may different for each client.
nvk15 22-Apr-14 22:18pm    
@Sunasara Imdadhusen : it is a relative path to the server. The user may not be able to browse it from UI, but he will just enter the folder path. How can this be done?
Sergejack 22-Apr-14 11:00am    
You could remove page validation for that peticuliar .Net page/service

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