将 1 个或多个(非图像)文件附加到 Rails 应用程序,并且必须安装图像处理库
我目前正在通过创建一个简单的项目管理应用程序来学习 Rails。我已经达到了这样的程度:我希望允许用户上传多个文件 - pdf、文档、xls 等。用户只需要能够一次附加一个文件,但可以关联多个文档有了一个项目是必须的。
我花了很多时间研究我的选择,看来两个主要插件是attachment_fu和paperclip。但从我读到的内容来看,这些似乎专门集中在图像的上传和随后的大小调整上,这是我不太关心的事情。有没有更简单的方法来实现我正在尝试的目标?
预先感谢大家。
I'm currently learning rails by creating a simple project management app. I've gotten to the point where I would like to be allow a user upload multiple files - pdfs, docs, xls etc. The user only needs to be able to attach one file at a time, but the possibilty to have multiple documents associated with a project is a must.
I've spent quite a lot of time researching my options, and it appears the two main plugins are attachment_fu and paperclip. From what I've read though, these appear to concentrate specifically on the upload and subsequent resizing of images, something I couldn't care less about. Is there a simpler way to achieve what I'm trying?
Thank you all in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能仍会考虑使用attachment_fu或回形针,因为它们是此类任务的“标准”库。它们适用于任何类型的文件。
You might still consider using attachment_fu or paperclip as those are the "standard" libraries for such tasks. And they work fine for any kind of file.
现在没有JS或者Flash就无法进行多重上传。您需要在视图中添加一些技巧来管理它。
The multi-upload can't be made without JS or Flash now. You need add some hack in your view to manage it.