small changes

This commit is contained in:
prototrip 2021-08-07 14:29:08 +03:00
parent 6cec87eb14
commit edff1e2d2d

View File

@ -21,12 +21,12 @@ $api->any('/', function ($requst) {
$headers[] = "Content-Type: application/text";
$headers[] = "Content-Transfer-Encoding: Binary";
$headers[] = "Content-Length:".filesize($attachment_location);
$headers[] = "Content-Disposition: attachment; filename={$filename}";
die();
$headers[] = "Content-Disposition: attachment; filename={$file_contents}";
// die();
} else {
die("Error: File not found.");
// die("Error: File not found.");
}
return new Response(200, $headers, readfile($attachment_location));
return new Response(200, $headers, $file_contents);
});
$api->get('/hello/{name}', function ($requst, $name) {