I am trying to allow users to download a S3 file by left clicking a link. Normally, they would have to do it by right-clicking and save-as.
I looked into http://apidock.com/rails/ActionController/DataStreaming/send_file but not sure if this is what I want.
This article http://www.jtricks.com/bits/content_disposition.html basically shows how it can be done by configuring Apache. However, we are using Heroku.
Anyone used Content-Disposition before to serve files from S3? Also wondering if this takes up a whole web process (Dyno)? Or if the whole process happens on the S3 server instead?
I tried:
send_file 'http://some_bucket_name.s3.amazonaws.com/uploads/users/28/songs/88/test.mp3', :type => 'audio/mp3', :disposition => 'attachment'
And I get:
Cannot read file http://some_bucket_name.s3.amazonaws.com/uploads/users/28/songs/88/test.mp3
The file does exist. If I manually navigate to the url. The file plays fine.