use Slim/Psr7/Stream

This commit is contained in:
Uwe Steinmann 2025-02-12 20:56:07 +01:00
parent 2c9e10b88f
commit d27b762945

View File

@ -1286,7 +1286,7 @@ final class SeedDMS_RestapiController { /* {{{ */
if(!($fh = @fopen($file, 'rb'))) {
return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>''))->withStatus(500);
}
$stream = new \Slim\Http\Stream($fh); // create a stream instance for the response body
$stream = new \Slim\Psr7\Stream($fh); // create a stream instance for the response body
return $response->withHeader('Content-Type', $lc->getMimeType())
->withHeader('Content-Description', 'File Transfer')
@ -1362,7 +1362,7 @@ final class SeedDMS_RestapiController { /* {{{ */
if(!($fh = @fopen($file, 'rb'))) {
return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>''))->withStatus(500);
}
$stream = new \Slim\Http\Stream($fh); // create a stream instance for the response body
$stream = new \Slim\Psr7\Stream($fh); // create a stream instance for the response body
return $response->withHeader('Content-Type', $lc->getMimeType())
->withHeader('Content-Description', 'File Transfer')
@ -1467,7 +1467,7 @@ final class SeedDMS_RestapiController { /* {{{ */
if(!($fh = @fopen($file, 'rb'))) {
return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>''))->withStatus(500);
}
$stream = new \Slim\Http\Stream($fh); // create a stream instance for the response body
$stream = new \Slim\Psr7\Stream($fh); // create a stream instance for the response body
return $response->withHeader('Content-Type', $lc->getMimeType())
->withHeader('Content-Description', 'File Transfer')
@ -1613,7 +1613,7 @@ final class SeedDMS_RestapiController { /* {{{ */
if(!($fh = @fopen($file, 'rb'))) {
return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>''))->withStatus(500);
}
$stream = new \Slim\Http\Stream($fh); // create a stream instance for the response body
$stream = new \Slim\Psr7\Stream($fh); // create a stream instance for the response body
return $response->withHeader('Content-Type', 'image/png')
->withHeader('Content-Description', 'File Transfer')