Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

whitedragon101

macrumors 65816
Original poster
Sep 11, 2008
1,336
334
I am trying to figure out how to do simple file download hosting on aws. Nothing clever, the links don't have to expire I just need to put exe files for games on there (we have security built into the game so the download needs none) get a download url for them and paste it onto my website download button. But I'm having the devils own job trying to figure out how to do it. I keep finding all this super complex web app stuff but not this simple task.

Many thanks
 

thisismyusername

macrumors 6502
Nov 1, 2015
476
729
You mean you want the files publicly and directly accessible by anyone? In other words, you're ok with anyone being able to download your files directly from AWS without any kind of credentials? If so, then you create a publicly accessible S3 Bucket, put your "objects" (i.e. files) in it, and setup a bucket policy to allow anyone to read the objects in it, and link to the objects. The "super complex web app stuff" tends to come into play when you want to restrict who can access it which is what most people want to do.

Warning: you will incur charges for data hosted in the bucket and for data transfers out of the bucket so keep that in mind. You should definitely review AWS S3 pricing before doing this so you don't get a surprise massive bill from them.

The basic idea is to:
1) Log into the AWS Console and go to the S3 section
2) Create a bucket in whatever region that's appropriate; the bucket name must be globally unique. Uncheck the "Block all public access" checkbox and check the "I acknowledge yadda yadda yadda" box below that. As you can tell, there are risks to doing this and AWS is trying really hard to let you know of them before you do this.
3) Go to the bucket you just created and edit it. You then apply a "bucket policy" that gives everyone read access to the objects within it. See "Step 2: Add a bucket policy" part of https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteAccessPermissionsReqd.html. That page describes how to host a static website out of an S3 bucket, which isn't exactly what you're trying to do but the process for setting up the bucket permissions is the same. Just copy/paste the example bucket policy on that page and edit it so it references the bucket you created. You can probably ignore the "Object access control lists" section below that.
4) Upload the files/objects to the bucket which you can do in the AWS Console if you want.
5) The objects are accessible via the following link: https://bucketname.s3-bucketregion.amazonaws.com/objectname
 
Last edited:
  • Like
Reactions: SigEp265 and zhenya

Dan15

macrumors newbie
Feb 14, 2021
6
0
How large are the files, and how much traffic do you expect? S3 can be quite expensive so you might want to consider alternatives too.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.