Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there,

I need help escaping backslashes on a file download in vb.net with javascript. The file I am downloading is like this:

\\Faheem-i5\recordings\TTGILBetterValue\20130122_195234_006387_1633548400.wav

the file is being downloaded but being named as follows:

_Faheem-i5 ecordingsTTGILBetterValue�30122_195234_006387_1633548400

Can anyone explain to me why this is happening and how do i escape the double backslashes and single backslashes from the string.

Thanks
Posted

1 solution

yes, u can do it with javascript:
var file_name = "\\Faheem\songs\TTGILBetterValue\000000.wav";
file_name = file_name.replace(/\\/g, "");

// NOTE: make sure that file_name contains \r, \n, \t chars or not...
 
Share this answer
 

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