Contract Principal Consultant and Technical Lead

Category: How To

Sorting Dropbox photos by year and month with Golang

This Golang program will organise all of your dropbox photos folder and move them into folders based on year and month.

Introduction

You can automatically upload all of your phone’s photos to dropbox. However, for some reason, it just doesn’t organise them. Perhaps there is a hidden option, but I cannot find it.

You end up with all your photos in one directory – in my case, it was 1000’s over many years which make it hard to open the folder on your computer.

Camera uploads folder has hundreds of files

Sorting The Files

Fortunately you can see that dropbox timestamp the files. This means you can take the following file as an example.

2019-03-06 20.07.12.jpg

Sorting into years.

Taking the above file as an example it would be nice to have a top-level year folder first. This could then go in the 2020 folder.

Photos sorted into years

Sorting into months.

Next it would be nice to sort any given year into months. I prefer them numbered so they can be ordered.

Photos sorted into months

Coding in Go

Golang allows you to create a cross-platform executable which will run on both Mac and Windows.

It only took an hour to write something to sort the files in Go to process the files as above.

The full code is here.

https://github.com/johndobie/sort-dropbox-photos

Running The Executable

Download the above code and then you can simply run the executable from the bin directory and point it at your camera uploads directory.

dropbox -uploadDir="D:/Dropbox/Camera Uploads"

Take a look at your dropbox folder and you should find all of your photos are neatly arranged.

Creating a Static Website in 5 Minutes Using AWS S3.

An S3 static website can be created in under 5 minutes.

First create a bucket and make it public.

Give the bucket a name.

Then make it public

Click create bucket to finish

Click on the new bucket.

Choose properties and fill in the static website hosting details.
Take note of the endpoint.

Create a simple HTML File index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Static Website</title>   
</head>
<body>

<div class="center">
    <b>Static Website on S3</b>
</div>

</body>
</html>

Upload the new HTML File and make sure it is public.

Test the new site using the endpoint from above.
http://dobie.co.uk.s3-website-us-east-1.amazonaws.com

© 2026 John Dobie

Theme by Anders NorĂ©n — Up ↑