blob: b94c02c19c6cd2fa6dfb9b73c7ec59e2593308f8 (
plain) (
tree)
|
|
<?php
require_once('include/security.php');
require_once('include/attach.php');
function attach_init(&$a) {
if(argc() < 2) {
notice( t('Item not available.') . EOL);
return;
}
$r = attach_by_hash(argv(1),((argc() > 2) ? intval(argv(2)) : 0));
if(! $r['success']) {
notice( $r['message'] . EOL);
return;
}
header('Content-type: ' . $r['data']['filetype']);
header('Content-disposition: attachment; filename=' . $r['data']['filename']);
echo $r['data']['data'];
killme();
}
|