I have a call for my download action document controller to serve a client with a downloadable object retrieved from s3. However, OpenURI seems to have problems with url clip analysis. This URL is accessible in the browser without any problems, but when I try to open it in the controller, I get a 403 Forbidden error.
documents_controller def download data = open(Document.find(params[:id]).upload.url) send_data data.read, :type => data.content_type, :x_sendfile => true end
url example would be
"https://s3.amazonaws.com/mybucket/documents/1/Screen_Shot.png?1372238888"
Error - OpenURI :: HTTPError 403 It is forbidden to fire on the first line of action when the URL is open. Any idea what this could be?
source share