Skip to content

Commit

Permalink
Upload files in Fedora with Multipart.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpendragon committed Jan 13, 2019
1 parent 025ff80 commit 46fb2d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/valkyrie/storage/fedora.rb
Expand Up @@ -41,7 +41,8 @@ def upload(file:, original_filename:, resource:)
request.headers['Content-Disposition'] = "attachment; filename=\"#{original_filename}\""
request.headers['digest'] = "#{sha1}=#{Digest::SHA1.file(file)}"
request.headers['link'] = "<http://www.w3.org/ns/ldp#NonRDFSource>; rel=\"type\""
request.body = file.tempfile.read
io = Faraday::UploadIO.new(file.tempfile.path, file.content_type)
request.body = io
end
find_by(id: Valkyrie::ID.new(identifier.to_s.sub(/^.+\/\//, PROTOCOL)))
end
Expand Down

0 comments on commit 46fb2d0

Please sign in to comment.