Loading ImageUtils.php +7 −3 Original line number Diff line number Diff line Loading @@ -31,12 +31,16 @@ class ImageUtils return new Filesystem($adapter); } public static function downloadImage(Filesystem $fs, string $path, string $name){ public static function downloadImage(Filesystem $fs, string $path, string $name) : void{ $mimetype = 'application/octet-stream'; $filesize = $fs->fileSize($path); $encodedFilename = urlencode($name); header("Content-Type: {$mimetype}"); try { $filesize = $fs->fileSize($path); header("Content-Length: {$filesize}"); }catch(Exception $e) { error_log($e->getMessage()); } header('Accept-Ranges: none'); header('Content-Disposition: inline' . ";filename=\"{$encodedFilename}\";filename*=UTF-8''{$encodedFilename}"); header('Cache-Control: private'); // Workarounds for IE weirdness Loading Loading
ImageUtils.php +7 −3 Original line number Diff line number Diff line Loading @@ -31,12 +31,16 @@ class ImageUtils return new Filesystem($adapter); } public static function downloadImage(Filesystem $fs, string $path, string $name){ public static function downloadImage(Filesystem $fs, string $path, string $name) : void{ $mimetype = 'application/octet-stream'; $filesize = $fs->fileSize($path); $encodedFilename = urlencode($name); header("Content-Type: {$mimetype}"); try { $filesize = $fs->fileSize($path); header("Content-Length: {$filesize}"); }catch(Exception $e) { error_log($e->getMessage()); } header('Accept-Ranges: none'); header('Content-Disposition: inline' . ";filename=\"{$encodedFilename}\";filename*=UTF-8''{$encodedFilename}"); header('Cache-Control: private'); // Workarounds for IE weirdness Loading