This script allows you to set up a custom file uploader for ShareX, a popular screenshot and file sharing tool. It generates a unique URL for each uploaded file and requires an authentication key for access control.
Before you get started, make sure you have the following:
- Composer: To install PHP dependencies.
- A web server with PHP support (e.g., Apache, Nginx).
- ShareX: Installed on your computer.
- Generate a secure authentication key here.
-
Clone or download this repository to your web server.
-
Install Composer if you haven't already. You can follow the installation instructions on the Composer website.
-
In the project directory, run the following command to install PHP dependencies:
composer install
- Edit the Existing .env File with Your Configuration
To set up your custom uploader, edit the provided .env file with your configuration settings.
Here's an example of how your .env file might look:
AUTHENTICATION_KEY=AuthenticationKey
UPLOAD_DIRECTORY=ss
DOMAIN_URL=https://domain.com
STRING_LENGTH=5
- AUTHENTICATION_KEY: Your secure password for authentication.
- UPLOAD_DIRECTORY: The directory where files will be uploaded.
- DOMAIN_URL: Your domain URL for generating file URLs.
- STRING_LENGTH: The desired length of the random string for file names.
Configure ShareX:
- Open ShareX on your computer.
- Go to
Destinations
and selectCustom uploader settings
. - Click
New
underUploaders
. - Set
Name
toCustom Uploader
. - Set
Method
toPOST
. - Set
Request URL
tohttps://domain.com/uploader.php
. - Set
Body
toForm data (multipart/form-data)
. - Add a
Name
field with the nameauthenticationKey
and the value being yourAUTHENTICATION_KEY
. - Set
File from name
tosharex
. - Save the settings.
Usage:
- Take a screenshot or capture a file using ShareX.
- ShareX will automatically upload the file to your custom uploader.
- ShareX will provide you with a unique URL for the uploaded file, which you can share with others.
Troubleshooting:
- If you encounter issues, make sure the permissions and directory structure are set up correctly for the upload directory.
- Ensure that the .env file is properly configured with the correct values.
- Check ShareX settings to ensure that the URL and authentication key match your configuration.
License:
This project is licensed under the MIT License. See the LICENSE file for details.