Browse Source

Avoid creating a temp file

pull/226/head
Adam Vessey 12 years ago
parent
commit
cf63033f79
  1. 5
      includes/datastream.inc

5
includes/datastream.inc

@ -41,10 +41,7 @@ function islandora_view_datastream(FedoraDatastream $datastream, $download = FAL
} }
drupal_page_is_cacheable(FALSE); drupal_page_is_cacheable(FALSE);
// Try not to load the file into PHP memory! // Try not to load the file into PHP memory!
$file = drupal_tempnam(file_directory_temp(), 'islandora'); $datastream->getContent('php://output');
$datastream->getContent($file);
readfile($file);
drupal_unlink($file);
exit(); exit();
} }

Loading…
Cancel
Save