mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Range requests: Extracted stream output handling to new class
This commit is contained in:
@@ -226,12 +226,13 @@ class AttachmentController extends Controller
|
||||
|
||||
$fileName = $attachment->getFileName();
|
||||
$attachmentStream = $this->attachmentService->streamAttachmentFromStorage($attachment);
|
||||
$attachmentSize = $this->attachmentService->getAttachmentFileSize($attachment);
|
||||
|
||||
if ($request->get('open') === 'true') {
|
||||
return $this->download()->streamedInline($attachmentStream, $fileName);
|
||||
return $this->download()->streamedInline($attachmentStream, $fileName, $attachmentSize);
|
||||
}
|
||||
|
||||
return $this->download()->streamedDirectly($attachmentStream, $fileName);
|
||||
return $this->download()->streamedDirectly($attachmentStream, $fileName, $attachmentSize);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user