Click here to Skip to main content
15,501,747 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i just make an application in which individual user can receive personal message which is sent by admin side through an email.

but when i use and sent it through email, it only takes hyperlink which is without space.

e.g.i send email like : http://www.abc.com/folder1 of attachment/xyz.jpg

so, this path i send to emp but it takes as hyperlink as http://www.abc.com/folder1[^] it does not contain some other means full path. it stopes after space.


so, what can i do for take whole path with space and make it as hyperlink.


Thanks and Regards..
Mitesh
Posted

replace your space with '%20', that is the encoding of space.

So your link will become http://www.abc.com/folder1%20of%20attachment/xyz.jpg[^]
 
Share this answer
 
Comments
Manas Bhardwaj 15-Jun-12 5:34am    
ditto +5!
[no name] 15-Jun-12 5:37am    
but dear, after the http://www.abc.com/ , the another things is dynamically. folder name is static but after the filename is different as different time. so how can i manage that things ..?
Farhan Ghumra 15-Jun-12 5:40am     CRLF
you can encode URL with HttpUtility.UrlEncode Method check this : http://msdn.microsoft.com/en-us/library/system.web.httputility.urlencode.aspx
[no name] 15-Jun-12 5:59am    
thanks but using UrlEncode it Gives '+' not '%20'
[no name] 15-Jun-12 5:59am     CRLF
Solved by using : string test_filename = System.Web.HttpUtility.UrlPathEncode(FileUpload1.FileName);
Try using a valid URL, replacing spaces with %20 (encoding for space) e.g.

http://www.abc.com/folder1%20of%20attachment/xyz.jpg

Look at the encodings for url here:

http://www.w3schools.com/tags/ref_urlencode.asp[^]
 
Share this answer
 
Comments
Espen Harlinn 15-Jun-12 10:22am    
5'ed!
Manas Bhardwaj 15-Jun-12 10:51am    
thx!

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