def get_image(params)
send_data(
File.binread("/tmp/#{params[:tmp_filename]}"),
filename: params[:filename],
type: params[:type], # content-type
disposition: "inline"
)
end
こんな感じで、後はcontrolerに設定してアクセスする。
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
def get_image(params)
send_data(
File.binread("/tmp/#{params[:tmp_filename]}"),
filename: params[:filename],
type: params[:type], # content-type
disposition: "inline"
)
end
こんな感じで、後はcontrolerに設定してアクセスする。
Register as a new user and use Qiita more conveniently
Go to list of users who liked