Query string resize and disposition for images

Jon White asked on March 17, 2015 13:18

Hi there,

I'm setting up a media library using page types and a media selection field for the image.

I was using a direct uploader field with GetFile and a querystring of:

?disposition=attachment&height=500

This would allow me to download the image at a reduced size.

However, now I have switched to a media selection field in the page type and now use this transformation:

<%# GetImageByUrl(Eval("FileAttachmentMediaSelect"),200,200,200,Eval("Title")) %>

This gives an output of:

<img alt="Satellite dish" src="/getmedia/45c6ae43-9e11-4239-9ed3-121bc014763c/dreamstime_Gwhitton-_10308601.jpg.aspx?width=4288&height=2848&ext=.jpg&maxsidesize=200">

I don't know if or how I can add the disposition of attachment (so that it'll download rather than link to a new window) or change the height so that it scales in the correct ratio. The above code defaults to adding the height and width of the full size image but allows max side size.

I know i can set the height and width it seems hard coded in the transformation so what do you do if you have both portrait and landscape images?

Sorry if this seems long or complicated, I hope someone can help me with this

Thank you in advance Jon

   Please, sign in to be able to submit a new answer.