Skip to content

Commit c48761f

Browse files
committed
Fix inline for shared URL.
1 parent dfbfab3 commit c48761f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Attachment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public function getTemporaryUrl(Carbon $expire, $inline = false)
451451
'id' => $this->uuid,
452452
'expire' => $expire->getTimestamp(),
453453
'shared_at' => Carbon::now()->getTimestamp(),
454-
'disposition' => 'inline',
454+
'disposition' => $inline ? 'inline' : 'attachment',
455455
])->toJson());
456456

457457
return route('attachments.download-shared', ['token' => $payload]);

src/Http/Controllers/ShareController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ public function download($token, Request $request)
4141
abort(403, Lang::get('attachments::messages.errors.expired'));
4242
}
4343

44-
$disposition = ($disposition = $request->input('disposition')) === 'inline' ? $disposition : 'attachment';
44+
if (property_exists($data, 'disposition')) {
45+
$disposition = $data->disposition === 'inline' ? $data->disposition : 'attachment';
46+
}
4547

4648
if ($file = $this->model->where('uuid', $id)->first()) {
4749
/** @var AttachmentContract $file */
@@ -52,4 +54,4 @@ public function download($token, Request $request)
5254

5355
abort(404, Lang::get('attachments::messages.errors.file_not_found'));
5456
}
55-
}
57+
}

0 commit comments

Comments
 (0)