From edff1e2d2d91e60da66acf6f4765b7badbc174e7 Mon Sep 17 00:00:00 2001 From: prototrip Date: Sat, 7 Aug 2021 14:29:08 +0300 Subject: [PATCH] small changes --- api.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api.php b/api.php index e60e96c..1ee14f1 100644 --- a/api.php +++ b/api.php @@ -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) {