Skip to content

Commit

Permalink
Set file label to original_filename when present
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpierce authored and tamsin johnson committed Sep 13, 2021
1 parent e85f848 commit a37fcb6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/actors/hyrax/actors/file_set_actor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ def label_for(file)
elsif file_set.import_url.present?
# This path is taken when file is a Tempfile (e.g. from ImportUrlJob)
File.basename(Addressable::URI.unencode(file.file_url))
elsif file.respond_to?(:original_filename) # e.g. Rack::Test::UploadedFile
file.original_filename
else
File.basename(file)
end
Expand Down

0 comments on commit a37fcb6

Please sign in to comment.