(adsbygoogle = window.adsbygoogle || []).push({});
I've made this a while ago and customized it a little recently, thought it would be cool to share as I've seen people still using FTP to upload images through ShareX.
My code does not use any kind of database or anything, nor duplicate check.
This is a PHP API, that you upload to your server then add to your sharex custom uploader.
This does not use FTP to upload, it uses a PHP API. Which is a lot faster, however it's not really secure as it lets you upload any files. So, this is mainly made for personal usage - don't give your secret key out!
NOTE: This tutorial is way more advanced than it needs to be, noob friendly.
What are the benefits of hosting your own images:
- You can delete them any time from your server.
- You store them on your own server, obviously.
- Most likely faster than Imgur.
- You can use CloudFlare to cache images, so it has same speed as Imgur once again.
Requirements:
- PHP Installed on the server (cPanel has this already / shared hosts)
- FTP/File Manager
- Text Editor / Sublime / Notepad
How to:
1.) Grab the upload.php code in bottom of the thread, then save it as upload.php
2.) Open it up in notepad, and change out the information.
In the top of the file after, you'll have some options. Such as how long the file name should be, what directory the images should be uploaded to and what the secret key should be. As well as domain url.
So, if you want to upload screenshots to:
You must login or register to view this content. you would have to have the following configuration:
You must login or register to view this content.
I don't think theres much to explain, but if you need help let me know.
3.) Upload the file as upload.php to your server so it can be accessed on
You must login or register to view this content.
4.) Make a directory, in my case it's "i" without quotes then i chmod it to 777 so i can upload files to it. See GIF:
You must login or register to view this content.
Once that's done, you've uploaded upload.php, edited it and made folder + chmod it.. you can go ahead to ShareX.
5.) In ShareX.. Go to destination settings then scroll till you see "Custom Uploader".
6.) Now in "Uploaders" you type in a name, like this for example then click add:
You must login or register to view this content.
- Then you put your domain and link to the upload.php as request url:
You must login or register to view this content.
- Then as File Form Name name you put "sharex".
- Then you add the secret key like this:
You must login or register to view this content. then simply click "Add".
Once that done, it should look similar to this (other than different key & domain):
You must login or register to view this content.
Now click test upload, and it should provide you with the URL to the image. If it does that, then it's done! Simply go to upload destinations and select custom image uploader:
You must login or register to view this content.