For a photo gallery-type project I would like to have certain images served as attachments (downloaded) and other served inline as normal.
The rule I have in mind is as follows:
If:
A. the file is over 500KB in size
AND
B. And its name does not end with either _medium.jpeg or _thumb.jpeg
Then:
Header Set Content-Disposition attachment
ForceType application/octet-stream
This is in Apache Server 2.2
I know how to handle condition B, above with <FilesMatch> and a little bit of REGEX.
But don't know how to approach capturing the file size, in condition A.
Any pointers?
The rule I have in mind is as follows:
If:
A. the file is over 500KB in size
AND
B. And its name does not end with either _medium.jpeg or _thumb.jpeg
Then:
Header Set Content-Disposition attachment
ForceType application/octet-stream
This is in Apache Server 2.2
I know how to handle condition B, above with <FilesMatch> and a little bit of REGEX.
But don't know how to approach capturing the file size, in condition A.
Any pointers?