diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/README b/README.txt similarity index 100% rename from README rename to README.txt diff --git a/images/Crystal_Clear_action_filenew.png b/images/Crystal_Clear_action_filenew.png deleted file mode 100644 index 7338dfe9..00000000 Binary files a/images/Crystal_Clear_action_filenew.png and /dev/null differ diff --git a/includes/datastream.inc b/includes/datastream.inc index 74517d7c..d332d06f 100644 --- a/includes/datastream.inc +++ b/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! diff --git a/tests/README b/tests/README.txt similarity index 100% rename from tests/README rename to tests/README.txt diff --git a/tests/islandora_web_test_case.inc b/tests/islandora_web_test_case.inc index cc5b8c67..a513de43 100644 --- a/tests/islandora_web_test_case.inc +++ b/tests/islandora_web_test_case.inc @@ -54,8 +54,8 @@ class IslandoraWebTestCase extends DrupalWebTestCase { * Stores the content of the Drupal Filter for later restoration. */ protected function backUpDrupalFilter() { - if (file_exists($this->configuration['filter_drupal_file'])) { - $this->originalDrupalFilterContent = file_get_contents($this->configuration['filter_drupal_file']); + if (file_exists($this->configuration['drupal_filter_file'])) { + $this->originalDrupalFilterContent = file_get_contents($this->configuration['drupal_filter_file']); } else { throw new Exception('Failed to find the required Drupal Filter configuration file.'); @@ -98,7 +98,7 @@ class IslandoraWebTestCase extends DrupalWebTestCase { * Stores the content of the Drupal Filter for later restoration. */ protected function restoreDrupalFilter() { - $file = $this->configuration['filter_drupal_file']; + $file = $this->configuration['drupal_filter_file']; if (isset($this->originalDrupalFilterContent)) { file_put_contents($file, $this->originalDrupalFilterContent); }