diff --git a/src/Controllers/DownloadController.php b/src/Controllers/DownloadController.php index faba9f6c..21fbd1bf 100644 --- a/src/Controllers/DownloadController.php +++ b/src/Controllers/DownloadController.php @@ -18,7 +18,7 @@ public function getDownload() $disk = Storage::disk($this->helper->config('disk')); $config = $disk->getConfig(); - if (key_exists('driver', $config) && $config['driver'] == 's3') { + if (key_exists('driver', $config) && $config['driver'] == 's3' && !is_null($this->helper->config('temporary_url_duration'))) { $duration = $this->helper->config('temporary_url_duration'); return response()->streamDownload(function () { echo file_get_contents($disk->temporaryUrl($file->path('storage'), now()->addMinutes($duration))); diff --git a/src/LfmStorageRepository.php b/src/LfmStorageRepository.php index 9753892d..502230ef 100644 --- a/src/LfmStorageRepository.php +++ b/src/LfmStorageRepository.php @@ -45,7 +45,7 @@ public function url($path) { $config = $this->disk->getConfig(); - if (key_exists('driver', $config) && $config['driver'] == 's3') { + if (key_exists('driver', $config) && $config['driver'] == 's3' && !is_null($this->helper->config('temporary_url_duration'))) { $duration = $this->helper->config('temporary_url_duration'); return $this->disk->temporaryUrl($path, now()->addMinutes($duration)); } else {