下载文件名

dev_forum
cxt 5 years ago
parent f38702e584
commit 8d8a0414e5

@ -14,7 +14,7 @@ class AttachmentsController < ApplicationController
update_downloads(@file) update_downloads(@file)
redirect_to @file.cloud_url and return redirect_to @file.cloud_url and return
end end
send_file absolute_path(local_path(@file)), type: @file.content_type.presence || 'application/octet-stream' send_file(absolute_path(local_path(@file)), filename: @file.filename, type: @file.content_type.presence || 'application/octet-stream')
update_downloads(@file) update_downloads(@file)
end end

Loading…
Cancel
Save