This is a simple and lightweight image uploader written in PHP.
The PHP script saves an image from a POST-Request to a folder and sends you the URL to access the image when being called.
All images/files can embed in applications such as Discord/WhatsApp.
-
Copy the upload.php file and upload it to your web server (e.g.
/var/www/website/upload.php). -
Customize the script:
-
Line 3: Exchange
YOUR_UPLOAD_SECRETwith your upload secret (for example random generated string e.g. of 20 characters). -
Line 4: Exchange
UPLOAD_DOMAINwith the domain of the upload script (e.g.http://yourdomain.com/upload.php) -
Line 5: Optional: Add a redirect URL, that you get redirected to, in case someone calls the website without an image uploader: Exchange
REDIRECT_URLwith this URL.
-
-
Download the
ShareX.sxcu-File (if you want to use ShareX) or theShareNix.json-File (if you want to use ShareNix) from the repository, and customize the custom uploader settings to fit your configuration of theupload.php-Script.Do the following changes whether what tool you are using:
- ShareX
k= Upload secretRequest URL= API URL (e.g.http://yourdomain.com/upload.php)- Optional:
d= file name (Optional!)
- ShareNix
key= Upload secretRequestURL= API URL (e.g.http://yourdomain.com/upload.php)FileFormName= file name (Optional!) Run the file after saving your changes.
- ShareX
If you want to learn more about the configuration files and how to generate them, this might interest you.
- Upload images by using ShareX or ShareNix!
Some errors you may encounter:
Make sure you call the PHP script, and not some other website.
Make sure your Apache/Nginx server is running.
Make sure you have PHP 7.4 installed & that the service is running (
systemctl status php7.4-fpm).
Make sure your PHP script has permissions to create files (
sudo chown -R www-data:www-data /var/www).