-
Notifications
You must be signed in to change notification settings - Fork 12
Files & Images
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
The final reference might look like this <img src="Image.ashx?3" alt='logo'>
Using the File.ashx handler to fetch large files is fast and efficient because the file is streamed from the storage asynchronously and is not 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 rotate an image simply pass rotate with the number of degrees. 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.
# rotate
Image.ashx?735A97A3-7A9A-4D3F-BE86-B3874E85E141&rotate=45
# resize
Image.asxh?3&height=200&width=300
Image resizing and rotation is provided by the ImageResizer project.