[英]where should I store files in rails?
1) I am downloading datafeeds (xml) files from a URL to unzip/import them into the database. 1) 我正在从 URL 下载数据馈送 (xml) 文件,以将它们解压缩/导入到数据库中。 Where should I store them in the rails file structure?我应该将它们存储在 rails 文件结构中的什么位置?
2) How does the rails file structure work, can rails access the entire hosting environment? 2)rails文件结构是如何工作的,rails可以访问整个托管环境吗? I basically mean, if I store my XML feed in /lib/files would I use that path in my models, or the longer full linux path?我的基本意思是,如果我将 XML 提要存储在 /lib/files 中,我会在模型中使用该路径,还是使用更长的完整 linux 路径?
Appreciate any advice!感谢任何建议!
Rails can access any thing that the user account under which the rails process is running, can access. Rails 可以访问运行 rails 进程的用户帐户可以访问的任何内容。 ie: if you run the rails server process under root (which is not a good idea BTW), the app could access any path that root can access.即:如果您在 root 下运行 rails 服务器进程(顺便说一句,这不是一个好主意),应用程序可以访问 root 可以访问的任何路径。 This might of course be limited by whatever access control mechanisms in place by the OS(ex: SELinux).当然,这可能会受到操作系统(例如:SELinux)的任何访问控制机制的限制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.