I am using Ruby2.6.0, Rails5.2.3 and Kibana6.6.1.
I need some help to realise pdf download automatically. Is there any way to download pdf/png automatically using the following url in controller? 'automatically' means users won't feel the file download and don't need to click download icon.
http://localhost:5601/api/reporting/jobs/download/jvhs9dga06559d006260ms70
Edit: Add the code I tried. It helps me to download a file. But I cannot open it with Chrome or sublime. It seems like the file is related to kibana Chromium sandbox (https://www.elastic.co/guide/en/kibana/current/reporting-chromium-sandbox.html). Is anybody know what type of this download file is and how to open it? How to save it as pdf/png file in my local folder?
File.open('./public/testfile.png', "wb") do |file|
file.write open("http://localhost:5601/api/reporting/jobs/download/jvhs9dga06559d006260ms70")
end