Merge branch 'master' of github.com:filegator/filegator

This commit is contained in:
Milos Stojanovic
2020-03-06 15:19:21 +01:00
2 changed files with 39 additions and 2 deletions

View File

@@ -28,6 +28,35 @@ Preview and edit files (New!)
Image gallery (New!)
## Sponsors
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://www.linkpreview.net/?utm_campaign=Sponsored%20GitHub%20FileGator" target="_blank">
<img title="Preview Web Links with our Free API service. Get JSON Response for any URL" width="177px" src="https://www.linkpreview.net/images/logo-dark.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.getping.info/?utm_campaign=Sponsored%20GitHub%20FileGator" target="_blank">
<img title="Trigger an email notification with a simple GET request" width="177px" src="https://www.getping.info/images/logo.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://www.ticksel.com/?utm_campaign=Sponsored%20GitHub%20FileGator" target="_blank">
<img title="Friendly website analytics made for humans" width="177px" src="https://interactive32.com/images/ticksel.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://interactive32.com/?utm_campaign=Sponsored%20GitHub%20FileGator" target="_blank">
<img title="Modern approach to software development" width="177px" src="https://interactive32.com/images/logo.png">
</a>
</td>
</tr><tr></tr>
</tbody>
</table>
## Typical use cases
- share a folder with colleagues, your team, friends or family
- give students access to upload their work

View File

@@ -65,13 +65,21 @@ class DownloadController
// @codeCoverageIgnoreEnd
});
$contentDisposition = HeaderUtils::DISPOSITION_ATTACHMENT;
$contentType = 'application/octet-stream';
if (pathinfo($file['filename'], PATHINFO_EXTENSION) == 'pdf') {
$contentDisposition = HeaderUtils::DISPOSITION_INLINE;
$contentType = 'application/pdf';
}
$streamedResponse->headers->set(
'Content-Disposition',
HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $file['filename'], 'file')
$contentDisposition
);
$streamedResponse->headers->set(
'Content-Type',
'application/octet-stream'
$contentType
);
$streamedResponse->headers->set(
'Content-Transfer-Encoding',