Commit e6db2d80 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

rollback useless try catch.

parent d87ecb2f
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -31,16 +31,12 @@ class ImageUtils
        return new Filesystem($adapter);
    }

    public static function downloadImage(Filesystem $fs, string $path, string $name) : void{
    public static function downloadImage(Filesystem $fs, string $path, string $name){
        $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