From 487b0592e3a10688f4d54e0feeef4f8ffb689bbe Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 2 Jun 2025 02:00:25 +0400 Subject: feat: download url --- public/upload.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/upload.php b/public/upload.php index 3b7f58a..96d1f4b 100644 --- a/public/upload.php +++ b/public/upload.php @@ -158,6 +158,10 @@ try { throw new RuntimeException("Failed to create a thumbnail (Error code {$thumbnail_error})"); } + $file_data['urls'] = [ + 'download_url' => INSTANCE_URL . "/{$file_data['id']}.{$file_data['extension']}" + ]; + if ($_SERVER['HTTP_ACCEPT'] == 'application/json') { json_response($file_data, null, 201); } else { -- cgit v1.2.3