Upgrades Questions on upgrading to version 6.x.
Version 6.x > Upgrades > GetDocumentURL(id) and GetAttachmentUrl add to link additional tilda ('~') View modes: 
User avatar
Member
Member
cadi2108 - 2/6/2012 6:01:00 AM
   
GetDocumentURL(id) and GetAttachmentUrl add to link additional tilda ('~')
Hello, I have problem with adding additional tilda ('~') at the start urk in following cases:

string s = CMSContext.GetDocumentUrl(id);
string url = CMS.TreeEngine.AttachmentURLProvider.GetAttachmentUrl((Guid)image, "image");

What can be reason for it and how can I fix it? Before upgrade from 5.5R2 to 6.0 it was working correctly.

Best regards.

User avatar
Kentico Support
Kentico Support
kentico_janh - 2/6/2012 8:41:31 AM
   
RE:GetDocumentURL(id) and GetAttachmentUrl add to link additional tilda ('~')
Hello,

That is a right behavior. There is no difference (in most of cases) between /test/url/path and ~/test/url/path addresses, because /test/url/path starts in the root of the application, whilst ~ is resolved as a path to the application, but the URL address, which starts with tilda, generates right address even if your application is under a virtual directory in your IIS (e.g. localhost/web1).

Best regards,
Jan Hermann

User avatar
Member
Member
cadi2108 - 2/6/2012 9:27:26 AM
   
RE:GetDocumentURL(id) and GetAttachmentUrl add to link additional tilda ('~')
For me it makes difference. For example, if document url get url /text.aspx and my site is http://www.home.example.com, I have result

http://www.home.example.com/~/text.aspx

and I need
http://www.home.example.com/text.aspx

Before upgrade my links worked correctly.

User avatar
Member
Member
cadi2108 - 2/6/2012 9:51:13 AM
   
RE:GetDocumentURL(id) and GetAttachmentUrl add to link additional tilda ('~')
I fixed it by nested GetDocumentUrl() in function GetAbsoluteUrl(). Thank you.

User avatar
Member
Member
Yash - 9/14/2012 4:06:03 PM
   
RE:GetDocumentURL(id) and GetAttachmentUrl add to link additional tilda ('~')
Hello,

I am having the same issue after upgrade from 5.5 R2 to 6.0 with SP1. Could you tell me where exactly you modify the code?

Thanks,
Yash

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/14/2012 6:15:14 PM
   
RE:GetDocumentURL(id) and GetAttachmentUrl add to link additional tilda ('~')
Hi,

Please check this KB article out where the common things are described which should be checked.

Best regards,
Juraj Ondrus