0
我試圖使用Ajax jquery調用來觸發Firefox上的下載彈出框。 我jQuery代碼是這樣的:如何使用Rails 3觸發下載彈出框
function download_clip(){
$.ajax({
url: '/controller/download_clip',
type: "GET",
complete: function (data_response) {
status = data_response.responseText; //the response variable from the presentation controller
console.log(status);
}
});
};
在我的控制器
:
def download_clip
send_file "public/output.mp4", :type=>"video/mp4", :filename => "output.mp4", :x_sendfile=>true, :disposition => 'inline'
end
任何想法如何觸發下載框?