Easy file sharing with S3 and Dropshare/ShareX

October 27, 2015

What we’re going to be doing

  1. Setting up a subdomain
  2. Setting up Amazon S3
  3. Setting up:
    1. Preliminary Setup
    2. ShareX (Windows)
    3. DropShare (Mac)

Setting up Amazon S3

If you already have an S3 Bucket created/setup, skip this section.

  1. Login to to your AWS Management Console.
  2. Go to Amazon S3.
  3. Create a new Bucket and take a note of the bucket name.
  4. Open bucket properties (in the top right) and add a bucket policy:

    {
      "Version":"2012-10-17",
      "Statement":[
        {
          "Sid":"AddPerm",
          "Effect":"Allow",
          "Principal": "*",
          "Action":["s3:GetObject"],
          "Resource":["arn:aws:s3:::YOUR-BUCKET-NAME-HERE/*"]
        }
      ]
    }   
    
  5. This bucket policy will make all of your uploads public. Now you can move on to setting up your subdomain.

Setting up a subdomain

  1. Login to your domain registrar, I use Gandi.
  2. Navigate to your equivalent “My Account” page.
  3. On Gandi, you have to click on your domain, and on the following page click “Edit the Zone”.
  4. Create a new zone.
  5. Create a CNAME record:
    1. Set the TTL to default.
    2. Set the name to the subdomain you want, for instance i, in my case, for i.hugo.sx
    3. Set the value to your-bucket-name.your-region.amazonaws.com., for instance, my-bucket.s3-ap-southeast-2.amazonaws.com.
  6. Hit save. You’ll have to wait somewhere in the range of 24 hours for the DNS populate.

Uploading to Amazon S3

Preliminary setup

  1. Go to your AWS Console, click on your name in the top right and then Security Credentials.
  2. You should be prompted to use IAM users, click on IAM users.
  3. Create a new user and give it a relevant name, e.g. dropshare-mac or sharex-windows, and hit enter.
  4. Copy the Access Key ID and Secret Access Key somewhere, you’ll need them for the next step.

Dropshare (Mac)

Dropshare costs 20.00 USD, which is quite reasonable for what it does. However, if you’re looking for something slightly cheaper and with arguably more features, check out Dropzone 3.

  1. Once you’ve downloaded Dropshare, open up the preferences and create a new Amazon S3 connection:
  2. Fill out the required fields, most a pretty self explanatory.
  3. When filling out the custom domain, don’t prefix it with http:// and don’t add / as a suffix.
  4. If you want to upload to a subfolder, you’ll want to add that in with the bucket name.
  5. Enjoy!

ShareX (Windows)

  1. Download ShareX.
  2. Open up Destinations from the list on the side.
  3. Click on Amazon S3 under Image Upload.
  4. Enter theAccess Key and Secret Key, you should end up with something like this:
  5. Now set Amazon S3 as your upload destination:

Questions? Comments? Tweet me, or email me.

comments powered by Disqus