file_path = "/home/myapp/#{Time.now}file.png" should do it
imgkit snapshot saving issues rails 4
-
23-07-2023 - |
题
I am using imgkit
gem in my application to take snapshot of current page
controller code is
kit = IMGKit.new(render_to_string)
t = kit.to_img(:png)
file_path = '/home/myapp/file.png'
file = kit.to_file(file_path)
working fine(image save in myapp/file.png ).
Now my question
- each time this method will overwrite
file.png
that i don't want - how can i display those saved images(suppose i give the saving path in images folder in my root app directory)
hope i explain my problem clearly, i am not using S3 for storing instead i am using my local machine
i am using https://github.com/csquared/IMGKit for my reference
解决方案
不隶属于 StackOverflow