Skip to content

Files & Images

nairdo edited this page Nov 10, 2011 · 5 revisions

There are two ways to fetch (reference) files and images from BLOB storage, using File.ashx or Image.ashx passing either the ID or GUID as shown in this example:

File.ashx?735A97A3-7A9A-4D3F-BE86-B3874E85E141

or

Image.asxh?3

Using the File.ashx handler to fetch large files is fast and efficient because the file will be streamed from the storage asynchronously and will not be loaded into memory to do so.

Using the Image.ashx handler gives you some additional features such as resizing, rotating, and caching (such transformations). To resize an image, simply pass height and width parameters or maxheight and maxwidth. Using the later will maintain the aspect ratio while using the former will force the image into the provided dimensions.

Image.asxh?3&height=200&width=300

Image resizing and rotation is provided by the ImageResizer project.

Clone this wiki locally