I understand better what you’re saying now. However, I hesitate to implement this suggestion for a number of reasons. I don’t think this option would be generally helpful for the vast majority of the users of the plugin. Also, the maximum file size is a moving target from site to site, as mentioned above, and perhaps even impossible to determine accurately. (In your suggested scenario, it’s possible that files of 9MB would still appear but not work.) To make matters worse, some servers are configured in such a way that I don’t have a 100% reliable method of obtaining the file size in the first place.
Here’s a hint toward implementing it yourself, though, if you’re interested in trying it. Find this block of code in gviewer.php (currently around line 70):
$fsize = gde_formatBytes($status['fsize']);
$code =<<<HERE
%A%
<iframe src="%U%" class="gde-frame" style="width:%W%; height:%H%; border: none;" scrolling="no"></iframe>\n
%B%
HERE;
and try replacing these relevant portions:
$fsize = gde_formatBytes($status['fsize']);
$max_mb_size = '10'; // set max size to display (in MB)
if ($status['fsize'] > $max_mb_size*1024*1024) {
$code = "%A% File too large to embed.\n %B%";
} else {
$code =<<<HERE
%A%
<iframe src="%U%" class="gde-frame" style="width:%W%; height:%H%; border: none;" scrolling="no"></iframe>\n
%B%
HERE;
}
You can of course change the text to your liking, or just remove it, but the %A% and %B% show the download link (depending on whether you’ve set the position to above or below the viewer) so you’ll want to leave one or both of these.
Let me know if you need more help. I’ll keep considering if this idea is something that should be implemented into the plugin as a setting in the future.
Kevin