header ('Content-Length: ' . $link['file_size']);
header ('Content-Type: ' . $link['mime_type']);
- if (!jirafeau_is_viewable ($link['mime_type']))
+ if (!jirafeau_is_viewable ($link['mime_type']) || !$cfg['preview'])
{
header ('Content-Disposition: attachment; filename="' .
$link['file_name'] . '"');
$cfg['rewrite'] = false;
/* An empty admin password will disable the admin interface. */
$cfg['admin_password'] = '';
+/* preview: false (will download file) or true (will preview in browser if
+ * possible) . */
+$cfg['preview'] = true;
if ((basename (__FILE__) != 'config.local.php')
&& file_exists (JIRAFEAU_ROOT.'lib/config.local.php'))