BinaryFileResponse example

try {
            $exportFilePath = $exporter->export($emotionId);
        } catch (Exception $e) {
            echo $e->getMessage();

            return;
        }

        @set_time_limit(0);

        $binaryResponse = new BinaryFileResponse($exportFilePath, 200, [], true, ResponseHeaderBag::DISPOSITION_ATTACHMENT);
        $binaryResponse->deleteFileAfterSend();
        $binaryResponse->send();

        exit;
    }

    /** * Uploads emotion zip archive to shopware file system * * @throws Exception * * @return void */
Home | Imprint | This part of the site doesn't use cookies.