added an image file for transfer and chagnes to api
This commit is contained in:
parent
d5ecd60790
commit
c6c7915e52
9
api.php
9
api.php
@ -10,16 +10,13 @@ $api->count = 4; // process count
|
||||
|
||||
$api->any('/', function ($requst) {
|
||||
$filename = "wifi.png";
|
||||
|
||||
$attachment_location = $_SERVER["DOCUMENT_ROOT"] . $filename;
|
||||
$headers = [];
|
||||
|
||||
if (file_exists($attachment_location)) {
|
||||
$headers[] = $_SERVER["SERVER_PROTOCOL"] . " 200 OK";
|
||||
if (file_exists($filename)) {
|
||||
$headers[] = "Cache-Control: public";
|
||||
$headers[] = "Content-Type: application/png";
|
||||
$headers[] = "Content-Type: image/png";
|
||||
$headers[] = "Content-Transfer-Encoding: Binary";
|
||||
$headers[] = "Content-Length:".filesize($attachment_location);
|
||||
$headers[] = "Content-Length:".filesize($filename);
|
||||
$headers[] = "Content-Disposition: attachment; filename={$filename}";
|
||||
die();
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user