THREAD: How to make your own custom ShareX Image Uploader (Custom domain etc)
  1. 02-06-2016, 05:17 PM
    Octolus's Avatar
    Octolus
    I defeated!
    Octolus's Avatar
    Octolus
    I defeated!
    617
    Posts
    41,824
    Reputation
    Jul 2011
    NextGenUpdate
    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.

  2. The Following 10 Users Say Thank You to Octolus For This Useful Post:

    , , , , , , , , ,

  3. 02-06-2016, 07:02 PM
    Tustin's Avatar
    Tustin
    Balls of Steel
    Tustin's Avatar
    Tustin
    Balls of Steel
    5,462
    Posts
    310,586
    Reputation
    May 2008
    NextGenUpdate
    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:
  4. 02-06-2016, 09:59 PM
    Octolus's Avatar
    Octolus
    I defeated!
    Octolus's Avatar
    Octolus
    I defeated!
    617
    Posts
    41,824
    Reputation
    Jul 2011
    NextGenUpdate
    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.

  5. 02-09-2016, 01:15 AM
    JB's Avatar
    JB
    [i]Remember, no Russian.[/i]
    JB's Avatar
    JB
    [i]Remember, no Russian.[/i]
    549
    Posts
    14,349
    Reputation
    Dec 2009
    NextGenUpdate
    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.
  6. 02-17-2016, 05:02 PM
    JoshxG's Avatar
    JoshxG
    Banned
    JoshxG's Avatar
    JoshxG
    Banned
    25
    Posts
    10
    Reputation
    Feb 2016
    NextGenUpdate
    Cool share! Appreciate it!
  7. 04-13-2016, 02:44 PM
    Jon Snow's Avatar
    Jon Snow
    Di DonDadda
    Jon Snow's Avatar
    Jon Snow
    Di DonDadda
    2,956
    Posts
    45,334
    Reputation
    Mar 2013
    NextGenUpdate
    i might try this shit later, thanks :yes:
  8. 07-06-2016, 06:22 PM
    airee's Avatar
    airee
    Gobble
    airee's Avatar
    airee
    Gobble
    2
    Posts
    10
    Reputation
    Jul 2016
    NextGenUpdate
    Not working for me.. Followed the instructions to a T.
  9. 07-06-2016, 06:24 PM
    airee's Avatar
    airee
    Gobble
    airee's Avatar
    airee
    Gobble
    2
    Posts
    10
    Reputation
    Jul 2016
    NextGenUpdate
    Here's what my setup us:
    You must login or register to view this content.
    You must login or register to view this content.
  10. 07-07-2016, 02:09 PM
    1
    Posts
    10
    Reputation
    Jul 2016
    NextGenUpdate
    Thank you so much for this tuturial, I got it working!
  11. 07-23-2016, 02:14 AM
    palmertm's Avatar
    palmertm
    Gobble
    palmertm's Avatar
    palmertm
    Gobble
    1
    Posts
    10
    Reputation
    Jul 2016
    NextGenUpdate
    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