Closed daniel-sc closed 3 months ago
So you actually can set whatever headers you want in your method, you just have to set them manually. I can update this in the docs. You'd do something like:
class MyController {
public function someStreamMethod() {
// must be a raw header
header('Content-Disposition: attachment; filename=myfile.txt');
// headers must be defined before you echo out anything.
echo 'something';
}
}
@n0nag0n this would indeed resolve my problem - thanks!
If I understand correctly, the URL parameters are not available when setting the streaming headers in
streamWithHeaders
. This is unfortunate, as one might like to set the filename or content-length in a header.Is there a solution for this possible?