Hi Guys,
I wanted to share with you an addition to the 6.4 API that was requested by the community as a life simplifying enhancement and we aim to please, so here it is:
We have added a Link.Download([resource handle], [optional file name]) API that enables you to download any resource without needing to write code (such as components with specific gateways) and such which is an overhead both in runtime and in development time. So the new API actually enables you to pass in a resource handler which can be a reference to a gateway resource, skin resource, file resource or any other resource that can be referenced by the resource handle which are quite a few. This actually opens a new window with target as "_self" and a content disposition parameter which indicates the name of the file that will be downloaded.
Only local server resources can be downloaded with the content disposition header as we can not control external resources but other resources will be opened by default in a new window so the API will still be useful for non server resources.
Here are a couple of examples of using it (this will also be featured in the companion kit as samples).
Download the current component gateway resource as a file named "graph1.jpg":
Link.Download(new GatewayResourceHandle(this, "graph"), "graph1.jpg");
Download an image named "Sea.jpg" from the images directory (the file name will automatically be 'Sea.jpg') :
Link.Download(new ImageResourceHandle("Sea.jpg"));
By the way we have also extended the amount of constructors GatewayResourceHandle has so you will not have to create a GatewayReference when creating a GatewayResourceHandler, so the above gateway sample is already using the shorter version.
Cheers,
Guy