diff options
| author | ilotterytea <iltsu@alright.party> | 2025-06-02 02:00:25 +0400 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-06-02 02:00:25 +0400 |
| commit | 487b0592e3a10688f4d54e0feeef4f8ffb689bbe (patch) | |
| tree | 4aa742ab42114bc355fb7ed3903cd7fa3c6a573a /public/upload.php | |
| parent | 2f2b152860de21c12adebafc25a3b5d75cdf3853 (diff) | |
feat: download url
Diffstat (limited to 'public/upload.php')
| -rw-r--r-- | public/upload.php | 4 |
1 files changed, 4 insertions, 0 deletions
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 { |
