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
08-23-2017, 04:57 AM #20
Varnex
Gobble
Not sure what I did wrong..
I followed the steps (with sharex 11.9.1)
and everything went well but whenever I screenshot something
and have it upload to my website, the url it outputs is
(Example) You must login or register to view this content.

instead of it being domain.com/i/image.png ,
its domain.comi/image.png.
and it doesn't add the "/" before the I like its supposed to..

Any help?
03-03-2018, 05:26 PM #21
I keep getting some weird javascript error in sharex telling me to enable it on a browser, which sharex isn't a browser so I really don't know what's wrong...
03-03-2018, 10:01 PM #22
iAmEMT
Gobble
Would it be possible to change some stuff to use a name value in the custom uploader settings in ShareX instead of using a random string generated by the php file? I'm trying to use the random adjective+random animal setting in the 12.1 update.
03-10-2018, 03:30 AM #23
So a friend and I did this and we ran into some issues, the tutorial was perfect aside from one thing. I'll detail what we did to fix it though in case anyone stumbles across this guide.
I'm using debian 7 and nginx.

1. We did cd /usr/local/nginx/html to navigate to the directory we want everything in
2. We uploaded the sample upload.php to a third party website and used wget in the directory we wanted it (in my case: /usr/local/nginx/html)
3. We did mv randomname.php upload.php to rename it to upload.php
4. Now with upload.php in /usr/local/nginx/html (double check this by typing dir) we edit it with nano upload.php
5. Here you can put in your domain, secret key, and directory the files will go to. make sure there is a / after the directory name you choose or else it will not read right
6. HERE IS WHAT WE MISSED!:

On line 28 of the sample upload.php we changed one thing.
echo $domain_url.$sharexdir.$filename.'.'.$fileType;
to
echo $domain_url."/".$sharexdir.$filename.'.'.$fileType;

7. Save and exit upload.php and now do mkdir yourdirectoryhere this is what will show in your url like yourdomain.com/yourdirectory/1uj57
8. Now chmod it by doing chmod -R 777 /yourdirectorynamehere/ this recursively sets the permissions for all files in the directory so that anything new you upload from sharex is still viewable without you giving permissions again
9. Tada! Do the sharex steps he says in the original post and you should be done
Last edited by MrEpicLuke ; 03-10-2018 at 03:35 AM.
10-25-2018, 07:54 PM #24
URL: No post data recieved

help pls
07-23-2019, 03:09 PM #25
thanks for this post :d
09-03-2019, 03:24 PM #26
    URL: <html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("4e8d788cdbd52a1283f59ce6a9a492fa");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="https://epicdrug.cf/upload.php?i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>




help pls

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo