app/controllers/downloads_controller.rb in hydra-head-3.1.4 vs app/controllers/downloads_controller.rb in hydra-head-3.1.5
- old
+ new
@@ -1,18 +1,19 @@
require 'mediashelf/active_fedora_helper'
class DownloadsController < ApplicationController
include MediaShelf::ActiveFedoraHelper
include Hydra::RepositoryController
+ include Hydra::AssetsControllerHelper
helper :downloads
# Note: Actual downloads are handled by the index method insead of the show method
# in order to avoid ActionController being clever with the filenames/extensions/formats.
# To download a datastream, pass the datastream id as ?document_id=#{dsid} in the url
def index
fedora_object = ActiveFedora::Base.load_instance(params[:asset_id])
if params[:download_id]
@datastream = fedora_object.datastreams[params[:download_id]]
- send_data @datastream.content, :filename=>@datastream.label, :type=>@datastream.attributes["mimeType"]
+ send_datastream @datastream
#send_data( Fedora::Repository.instance.fetch_custom(params[:document_id], "datastreams/#{datastream_id}/content") )
else
@datastreams = downloadables( fedora_object )
end
end