|
|
|
@ -19,10 +19,6 @@ function islandora_datastream_as_attachment($object_id, $dsid) {
|
|
|
|
|
try { |
|
|
|
|
$restConnection = new RestConnection($user); |
|
|
|
|
$fedora_object = new FedoraObject($object_id, $restConnection->repository); |
|
|
|
|
} catch (Exception $e) { |
|
|
|
|
drupal_set_message(t('Error getting Islanndora datastream $d for object %s', array('%s' => $object_id, '%d' => $dsid)), 'error'); |
|
|
|
|
return""; |
|
|
|
|
} |
|
|
|
|
header('Content-type: ' . $fedora_object[$dsid]->mimetype); |
|
|
|
|
if($fedora_object[$dsid]->controlGroup == 'M' || $fedora_object[$dsid]->controlGroup == 'X') { |
|
|
|
|
header('Content-length: ' . $fedora_object[$dsid]->size); |
|
|
|
@ -34,6 +30,9 @@ function islandora_datastream_as_attachment($object_id, $dsid) {
|
|
|
|
|
} |
|
|
|
|
print($fedora_object[$dsid]->content); |
|
|
|
|
exit(); |
|
|
|
|
} catch (Exception $e) { |
|
|
|
|
return drupal_not_found();; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function islandora_get_datastream_parents($islandora_object) { |
|
|
|
|