Post: How to make your own custom ShareX Image Uploader (Custom domain etc)
02-06-2016, 05:17 PM #1
Octolus
I defeated!
(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! Smile

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.

Last edited by Octolus ; 02-06-2016 at 05:25 PM.

The following 10 users say thank you to Octolus for this useful post:

aaron25th, DaenerysTargy, Father Luckeyy, Frosty, Gekkougasz, i0ancy-, Joel, Kam, Kryptus, THΞSPIKYBROHD
02-06-2016, 07:02 PM #2
Tustin
Balls of Steel
This is nice, but you should really have a defined set of file extensions that are only allowed to be uploaded. I know you have that secret key but still, this is just another attack vector. Try something like this:
02-06-2016, 09:59 PM #3
Octolus
I defeated!
Originally posted by Tustin View Post
This is nice, but you should really have a defined set of file extensions that are only allowed to be uploaded. I know you have that secret key but still, this is just another attack vector.


Yeah, i did not though since I upload all kind of files so I'd have to list each one. Could also add a htaccess to force download, or disable PHP in that folder so that would be no concern Smile

You must login or register to view this content.
Last edited by Octolus ; 02-06-2016 at 10:07 PM.
02-09-2016, 01:15 AM #4
JB
[i]Remember, no Russian.[/i]
A hardcoded secret is a terrible idea - using a dynamic session with a public and private key, and returning data in json format is much better than just echoing strings back. Just my 2 cents.
02-17-2016, 05:02 PM #5
JoshxG
Banned
Cool share! Appreciate it!
04-13-2016, 02:44 PM #6
Jon Snow
Di DonDadda
i might try this shit later, thanks :yes:
07-06-2016, 06:22 PM #7
airee
Gobble
Not working for me.. Followed the instructions to a T.
07-06-2016, 06:24 PM #8
airee
Gobble
Here's what my setup us:
You must login or register to view this content.
You must login or register to view this content.
07-07-2016, 02:09 PM #9
Thank you so much for this tuturial, I got it working!
07-23-2016, 02:14 AM #10
I'm getting this error, help?

<b>Notice</b>: Undefined variable: key in <b>Awesome face:\website\upload.php</b> on line <b>13</b><br />

Thanks

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo