src/Components/S3FileSystem.php
public function streamBlob($container, $name, $params = [])
    {
        try {
            $this->checkConnection();

            /** @var \Aws\Result $result */
            $result = $this->blobConn->getObject(
                [
                    'Bucket' => $container,
                    'Key'    => $name
                ]
            );

            header('Last-Modified: ' . $result->get('LastModified'));
            header('Content-Type: ' . $result->get('ContentType'));
            header('Content-Length:' . intval($result->get('ContentLength')));

            $disposition =
                (isset($params['disposition']) && !empty($params['disposition'])) ? $params['disposition'] : 'inline';

            header('Content-Disposition: ' . $disposition . '; filename="' . $name . '";');
            //echo $result->get('Body');
            $result['Body']->rewind();
            $chunk = \Config::get('df.file_chunk_size');
            while ($data = $result['Body']->read($chunk)) {
                echo $data;
            }
        } catch (\Exception $ex) {
            if ($ex instanceof S3Exception) {
                $code = $ex->getStatusCode();
                $status_header = "HTTP/1.1 $code";
                header($status_header);
                header('Content-Type: text/html');
                echo 'Failed to stream/download file. File ' . $name . ' was not found. ' . $ex->getMessage();
            } else {
                throw new DfException('Failed to stream blob: ' . $ex->getMessage());
            }
        }
    }
public function streamBlob($container, $name, $params = [])
    {
        try {
            $this->checkConnection();

            /** @var \Aws\Result $result */
            $result = $this->blobConn->getObject(
                [
                    'Bucket' => $container,
                    'Key'    => $name
                ]
            );

            header('Last-Modified: ' . $result->get('LastModified'));
            header('Content-Type: ' . $result->get('ContentType'));
            header('Content-Length:' . intval($result->get('ContentLength')));

            $disposition =
                (isset($params['disposition']) && !empty($params['disposition'])) ? $params['disposition'] : 'inline';

            header('Content-Disposition: ' . $disposition . '; filename="' . $name . '";');
            //echo $result->get('Body');
            $result['Body']->rewind();
            $chunk = \Config::get('df.file_chunk_size');
            while ($data = $result['Body']->read($chunk)) {
                echo $data;
            }
        } catch (\Exception $ex) {
            if ($ex instanceof S3Exception) {
                $code = $ex->getStatusCode();
                $status_header = "HTTP/1.1 $code";
                header($status_header);
                header('Content-Type: text/html');
                echo 'Failed to stream/download file. File ' . $name . ' was not found. ' . $ex->getMessage();
            } else {
                throw new DfException('Failed to stream blob: ' . $ex->getMessage());
            }
        }
    }
@param string $container
@param string $name
@param array  $params

@throws DfException