ASPX templates
Version 4.x > ASPX templates > Get images/files-path in API View modes: 
User avatar
Member
Member
Peter Frank - 3/4/2011 2:46:48 AM
   
Get images/files-path in API
Hi

We have to write a tool that allows presenting cms-data via XML. E.g. custom-table-data with text and images/files or nodes containing custom datatypes. The background is, that some remote application has to access these data.

Now, I'm trying for a while to access the full path of the files/images using the API. Is there an easy way to get a full url of an image with possible parameters for scaling?

I tried

http://www.site.com/getattachment/aef6ec1f-8848-4d23-995d-8166f6025307/getfile.aspx?maxsidesize=75

but that didn't work.


Best Regards,

Peter

User avatar
Member
Member
Peter Frank - 3/4/2011 3:13:44 AM
   
RE:Get images/files-path in API
Never mind, as usual, found the soulution as soon as I posted the problem.
Here is my current approach:


Dim tp As New CMS.TreeEngine.TreeProvider
Dim tn As TreeNode = tp.SelectSingleNode(New Guid(myRow("Image1").ToString), "en-US", "mySite")
dim myImagePath as string = UrlHelper.GetAbsoluteUrl(UrlHelper.ResolveUrl("~" + tn.NodeAliasPath)) & ".aspx?maxsidesize=150"