Skip to content

Commit

Permalink
add some debug to downloads controller to see what's up with filename
Browse files Browse the repository at this point in the history
  • Loading branch information
cziaarm committed Oct 15, 2024
1 parent eb94391 commit 42cd705
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/hyrax/downloads_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ def send_file_contents
Aws::S3::Object.new(ENV['AWS_BUCKET'], file.digest.first.to_s.gsub('urn:sha1:', ''))
end
if s3_object.exists?
STDERR.puts "##################################"
STDERR.puts "Redirecting to S3 using the filename #{file.original_name}"
STDERR.puts "File object: #{file}"
redirect_to s3_object.presigned_url(
:get,
expires_in: 3600,
response_content_disposition: "attachment\; filename=#{file.original_name}"
response_content_disposition: "attachment\; filename=#{file.original_name}"
)
return
end
Expand Down

0 comments on commit 42cd705

Please sign in to comment.