Reputation: 11
I get a blob from a function in my oracle Datenbank. Users of my Rails App should be able to download these BLOB. My Problem is, that after clicking on download, the BLOB file is shown inline in the browser, but it should be download as a file.
link:
= link_to export_pldw_plausibility_path, :class => "btn btn-primary
action-button" do
%span.glyphicon.glyphicon-pencil
%span.hidden-xs
= "Export"
route:
resources :pldw_plausibilities do
get 'export', on: :member
end
controller:
def export
send_data PldwPlausibility.export(params[:id]), :filename => "test.BLOB",
:disposition => 'attachment'
end
Model:
def self.export(id)
return plsql.pld.pld_mdc.exportMDOC('PLD_PLAUSIBILITY', id.to_i)
end
Upvotes: 0
Views: 256