I've working to be able to place files to be downloaded to my readers in some of my posts, so I worked non-stop on it.

My intentions from the beginning where two:

  1. Enable readers to download a file in a post (duh).
  2. Be able to limit downloads if possible to members at some point in the future.

I accomplished #1 and kind of solved #2, although there are some caveats. But hey, its better than nothing!

Now, let's get into it.

Warning: ghost doesn't manage files. We are relying in third party services to "host" the file to be downloaded and then we make it kind of "easy" to the reader to get it.

Enable readers to download a file in a post

This one is very easy honestly. If you followed my post about guest posting, then you learned how to use a service like Google Drive to host files.

Basically, you'll need a link to your file to be "downloaded". If you have a preferred place to host this files and enable downloads, fantastic. If you want a free place to do so, I would recommend Google Drive and follow part of my tutorial here.

After you have your link, what I do is place it in a button inline, using a HTML card, and then forcing it to make a direct download. Check this button as an example:

Click to Download

As you can see, when you click the button, the save as window pops up right away. This allows you to get the file without checking too much info about it.

Tip: if you are using Google Drive or any other cloud service, and you want to force download the file: make sure is something not supported by a web browser such as a picture. If you don't do that, the file will open instead in the browser, showing the url you wanted to hide. In this case, just zip the file.

Here's the code you need to put in your html:

<html>

<head>
    <style>
        a.custom-button { 
		         /* yourstyle */
        }
    </style>
</head>

<body>
    <a onclick="location.href='xxxxyourlinkxxxx'"
        class="custom-button" download>Click to Download</a>
</body>

</html>

With this, you are ready to place any file to download in a blog post. If you want to limit it to members, then just use it on a post limited to those users.

Issue: if you use the inspector in a browser, you will still be able to see the link. Not a lot of people know this, but just making sure you understand this is not bulletproof for paying members only. If they copied the link with this before stoping payments, then it's done.

Be able to limit downloads if possible to members at some point in the future.

In part, using the almost-hiding-link trick works in some way for the average user. But what happens with those smart members that only want to get info the first month and then they dip?

My closest solution yet, is to combine the button with a temporary download link. This works in any environment (Ghost Pro, Digital Ocean, Digital Press, etc.)

Wait, a temporary link? Yes, one that is limited by time and amount of downloads.

Interesting. How can we do that!? Simple, using Firefox Send. It's damn free!

Just go to the page, upload a file and specify the parameters of time and amount of downloads:

You can even specify a password if you think it's convenient.

After that, you will obtain a temporary link that will expire when either the amount of downloads of maximum time is enabled. In the case of members, if you have 20 of them, you can specify 20 downloads and be clear that is one per member.

After that, the link will stop working and you will ensure that you control when downloads are possible, even to your members.

Caveat: ultimately, this is a numbers game and you are still relying on some trust. The good thing is, that links will expire no matter what, so that's good news. Now, if you get new members or something else happens, you will have to do some extra work since the parameters have changed.

This is not the nicest or best method probably out there, but it's still easy, free and works in any environment. For me, this is a win. What about you!? Is this helpful? Let me know in the comments section.