From 721c047a069e956001f75c61820ae43da510f5a5 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 21 Jun 2025 00:36:33 +0500 Subject: feat: json support --- public/index.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'public') 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 -- cgit v1.2.3