Browse Source

Merge pull request #255 from willtp87/7.x

some datastreams were downloading into
pull/257/head
Jonathan Green 12 years ago
parent
commit
6930c09b2d
  1. 6
      includes/datastream.inc

6
includes/datastream.inc

@ -37,7 +37,11 @@ function islandora_view_datastream(FedoraDatastream $datastream, $download = FAL
header('Content-length: ' . $datastream->size);
}
if ($download) {
header("Content-Disposition: attachment; filename=\"{$datastream->label}\"");
// Browsers will not append all extensions.
$mime_detect = new MimeDetect();
$extension = $mime_detect->getExtension($datastream->mimetype);
$filename = $datastream->label . '.' . $extension;
header("Content-Disposition: attachment; filename=\"$filename\"");
}
drupal_page_is_cacheable(FALSE);
// Try not to load the file into PHP memory!

Loading…
Cancel
Save