added an image file for transfer and chagnes to api
This commit is contained in:
parent
c6c7915e52
commit
9e5ae12454
4
api.php
4
api.php
@ -18,11 +18,11 @@ $api->any('/', function ($requst) {
|
||||
$headers[] = "Content-Transfer-Encoding: Binary";
|
||||
$headers[] = "Content-Length:".filesize($filename);
|
||||
$headers[] = "Content-Disposition: attachment; filename={$filename}";
|
||||
die();
|
||||
// die();
|
||||
} else {
|
||||
die("Error: File not found.");
|
||||
}
|
||||
return new Response(200, $headers, $filename);
|
||||
return new Response(200, $headers, readfile($filename));
|
||||
});
|
||||
|
||||
$api->get('/hello/{name}', function ($requst, $name) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user