|
@@ -0,0 +1,29 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Controller;
|
|
|
+
|
|
|
+
|
|
|
+use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
|
+use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
|
|
+use Symfony\Component\Routing\Annotation\Route;
|
|
|
+
|
|
|
+class StreamingController extends AbstractController {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return \Symfony\Component\HttpFoundation\BinaryFileResponse
|
|
|
+ *
|
|
|
+ * @Route(
|
|
|
+ * name = "pass",
|
|
|
+ * path = "/pass"
|
|
|
+ * )
|
|
|
+ */
|
|
|
+ public function pass() {
|
|
|
+ $response = $this->file('/etc/passwd', 'blougou', ResponseHeaderBag::DISPOSITION_INLINE);
|
|
|
+
|
|
|
+ // Defaults to 'attachment; filename="${basename($file)}"'. When not using
|
|
|
+ // the 2nd and 3rd arguments:
|
|
|
+ // $response->headers->set('Content-disposition', 'inline');
|
|
|
+
|
|
|
+ return $response;
|
|
|
+ }
|
|
|
+}
|