diff options
| author | ilotterytea <iltsu@alright.party> | 2025-06-21 00:36:33 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-06-21 00:36:33 +0500 |
| commit | 721c047a069e956001f75c61820ae43da510f5a5 (patch) | |
| tree | ae1d9b13d936e23f2c02e1f087d06357fce4517b /public/index.php | |
| parent | 6e6f424391ba956eb672b940e1f1fda5e9e7790e (diff) | |
feat: json support
Diffstat (limited to 'public/index.php')
| -rw-r--r-- | public/index.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/public/index.php b/public/index.php index 265a03e..d09aeab 100644 --- a/public/index.php +++ b/public/index.php @@ -102,6 +102,15 @@ if (FILE_CATALOG_FANCY_VIEW && $file_id) { exit; } + if (IS_JSON_REQUEST) { + unset($file['password']); + $file['urls'] = [ + 'download_url' => INSTANCE_ORIGINAL_URL . "/{$file['id']}.{$file['extension']}" + ]; + json_response($file, null); + exit; + } + $file['full_url'] = FILE_UPLOAD_DIRECTORY_PREFIX . "/{$file['id']}.{$file['extension']}"; // formatting the file size |
