Downloads
ReturnAttachment makes browsers download the image, and Filename names the file.
use SomehowDigital\ImgProxy\Url;
$base = Url::create()->source('https://example.com/photos/cat.jpg');use SomehowDigital\ImgProxy\Option\Filename;use SomehowDigital\ImgProxy\Option\ReturnAttachment;use SomehowDigital\ImgProxy\Option\Width;
$base->options(new ReturnAttachment(), new Filename('cat-large.jpg'), new Width(2000))->build('jpg');// _/att:1/fn:Y2F0LWxhcmdlLmpwZw:1/w:2000/plain/https%3A%2F%2Fexample.com%2Fphotos%2Fcat.jpg@jpgPass the file name as it is. The library sends it Base64-encoded, as imgproxy expects.