* Include $filepath in the response, for viewing and downloading.
* If provided, $filesize is used to size the HTTP request,
* otherwise it's value is calculated
+ * @param string $filepath the absolute path to the file to send
+ * @param $filesize optional, calculated if unkown
*/
static function sendFile(string $filepath, $filesize) {
if (is_string(common_config('site', 'x-static-delivery'))) {
$mimetype = $this->attachment->getFileOrThumbnailMimetype();
if (empty($filepath)) {
- $thiis->clientError(_('No such attachment'), 404);
+ $this->clientError(_('No such attachment'), 404);
}
$filename = MediaFile::getDisplayName($this->attachment);
$this->thumb_c = $this->boolean('c');
}
+ /**
+ * Show an inline representation of an attachment of the size
+ * requested in the GET variables (read in the constructor). Tries
+ * to send the most appropriate file with the correct size and
+ * headers or displays an error if it's not possible.
+ */
public function showPage()
{
$mimetype = $this->attachment->getFileOrThumbnailMimetype();
if (empty($filepath)) {
- $thiis->clientError(_('No such attachment'), 404);
+ $this->clientError(_('No such attachment'), 404);
}
$filename = MediaFile::getDisplayName($this->attachment);