123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- defined('GNUSOCIAL') || die();
- class Attachment_viewAction extends AttachmentAction
- {
- public function showPage(): void
- {
-
-
-
- @ini_set('display_errors', 0);
- header("Content-Description: File Transfer");
- header("Content-Type: {$this->mimetype}");
- if (in_array(common_get_mime_media($this->mimetype), ['image', 'video'])) {
- header("Content-Disposition: inline; filename=\"{$this->filename}\"");
- } else {
- header("Content-Disposition: attachment; filename=\"{$this->filename}\"");
- }
- header('Expires: 0');
- header('Content-Transfer-Encoding: binary');
- parent::sendFile();
- }
- }
|