Search code examples
ruby-on-railsamazon-s3amazon-web-servicesamazon-cloudfront

Does Amazon Cloudfront hide the file from being download directly?


Im trying to wrap my head around Cloudfront. We notice some video sites don't allow us to download the video. I.e. there is no physical link to the file. Or at least, I am not able to locate it in the flash player's source code using Firebug.

On some sites, a typical block of code could look like the following:

<object width="496" height="24" type="application/x-shockwave-flash" id="media_player" name="media_player" data="/flash/jwplayer/player.swf" ....>

  <param name="flashvars" value="file=http://some_bucket_name.s3.amazonaws.com/uploads/users/1/foo.mp3&amp;title=Test&amp;author=Foobar&amp;plugins=&amp;autostart=true&amp;controlbar=bottom&amp;repeat=none&amp;screencolor=000000">

</object>

Above, you notice, from the html source code, that the file can be 'cleverly' downloaded through the physical link: http://some_bucket_name.s3.amazonaws.com/uploads/users/1/foo.mp3.

I understand what a CDN is. A good explanation can be found here.

If we use Cloudfront, will this disallow end-users from 'cleverly' downloading media files directly from our app since the files will be streamed?


Solution

  • As Wukerplank suggested: "You can make it difficult, but you can't make it impossible."