Rails: How can I use system zip on Heroku to make a docx from an xml template?

时光怂恿深爱的人放手 提交于 2019-12-02 01:18:18

Can't you just a create directory within #{Rails.root}/tmp called, say, #{Process.pid}_docx/something_nice/? Copy (or symlink) what you need into:

#{Rails.root}/tmp/#{Process.pid}_docx/something_nice/

Then

system "cd #{Rails.root}/tmp/#{Process.pid}_docx/; zip -r x.zip something_nice"

And then you have:

#{Rails.root}/tmp/#{Process.pid}_docx/x.zip

With a nice pretty internal structure that doesn't include your PID.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!