From 2f2b152860de21c12adebafc25a3b5d75cdf3853 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 2 Jun 2025 01:59:00 +0400 Subject: feat: info for file uploader software --- public/index.php | 16 ++- public/static/img/icons/paste_plain.png | Bin 0 -> 605 bytes public/static/style.css | 9 ++ public/uploaders.php | 178 ++++++++++++++++++++++++++++++++ 4 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 public/static/img/icons/paste_plain.png create mode 100644 public/uploaders.php (limited to 'public') diff --git a/public/index.php b/public/index.php index ef41ae6..9da069d 100644 --- a/public/index.php +++ b/public/index.php @@ -77,7 +77,14 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/../lib/partials.php'; -

Max file size:

+
@@ -262,6 +269,11 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/../lib/partials.php'; } function addUploadedFile(file) { + let file_url = `/${file.id}.${file.extension}`; + if (file.urls && file.urls.download_url) { + file_url = file.urls.download_url; + } + return `
@@ -277,7 +289,7 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/../lib/partials.php';

${(file.size / 1024 / 1024).toFixed(2)} MB

diff --git a/public/static/img/icons/paste_plain.png b/public/static/img/icons/paste_plain.png new file mode 100644 index 0000000..c0490eb Binary files /dev/null and b/public/static/img/icons/paste_plain.png differ diff --git a/public/static/style.css b/public/static/style.css index 15550e4..e0ae3e0 100644 --- a/public/static/style.css +++ b/public/static/style.css @@ -56,6 +56,15 @@ footer { padding-top: 4px; } +code { + background: var(--box-tab-background); + padding: 4px 8px; +} + +table.vertical { + border-spacing: 8px; +} + /** FORM */ button[type=submit] { background: linear-gradient(0deg, var(--box-tab-background), var(--background)); diff --git a/public/uploaders.php b/public/uploaders.php new file mode 100644 index 0000000..57cf8b4 --- /dev/null +++ b/public/uploaders.php @@ -0,0 +1,178 @@ + $v) { + $type = ucfirst(explode('/', $v)[0]); + if (!array_key_exists($type, $file_types)) { + $file_types[$type] = []; + } + + if (!in_array($k, $file_types[$type])) { + array_push($file_types[$type], $k); + } +} +?> + + + + Uploaders - <?= INSTANCE_NAME ?> + + + + + + +
+ + +
+
+

File Uploaders

+

Configure your software to work with

+
+ + +
+ +
+
+

ShareX

+

(Destinations → Custom uploader settings → New)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:
Request URL:/upload.php
Destination type:Image uploader
Method:POST
Body:Form data (multipart/form-data)
Headers:Accept: application/json
File form name:file
URL:{json:data.urls.download_url}
+

Then, select it via Destinations → Image uploader → Custom image + uploader

+
+ + +
+
+

Chatterino

+

(Settings → External tools → Image Uploader)

+
+ + + + + + + + + + + + + + + + + +
Request URL:/upload.php
Form field:file
Extra headers:Accept: application/json
Image link:{data.urls.download_url}
+
+
+ + +
+

API

+
+

Endpoint

+
+

POST /upload.php

+
+ +
+

Request Format

+
+ + + + + + + + + + + + + + + + + + + + + +
Method:POST
Content-Type:multipart/form-data
Headers:Accept: application/json
File field:file
Max file size:
+
+ +
+

Supported file extensions

+
+ + $exts): ?> + + + + + +
:
+
+
+
+
+ + + + + \ No newline at end of file -- cgit v1.2.3