简体   繁体   English

使用Paperclip上传文件夹/多个文件(Rails gem)

[英]Uploading folders/multiple files using Paperclip ( Rails gem )

I'm using paperclip to upload some attachments to my application. 我正在使用paperclip将一些附件上传到我的应用程序。 This works fine, but i'm stuck with the following: My client wants a photo album on the website, so he needs to be able to select multiple fields or a folder when uploading batches of photo's. 这很好,但我坚持以下:我的客户想在网站上有相册,所以他需要能够在上传批量照片时选择多个字段或文件夹。 I found a screencast called 'multiple file selection with paperclip', but that one, and many others, just add another file field to the form when the first file added. 我找到了一个名为“使用paperclip进行多文件选择”的截屏视频,但是当第一个文件添加时,该视频广播和其他许多文件字段只是向表单添加了另一个文件字段。 This way, the user still has to add every file separately. 这样,用户仍然必须单独添加每个文件。 I want to be able to upload a whole batch with one click. 我希望能够一键上传整批产品。 After my second googling session I found some guys who let the user zip the file and upload it. 在我的第二次谷歌搜索会议后,我找到了一些让用户压缩文件并上传它的人。 They then unpack and loop through the file. 然后他们解压缩并循环遍历文件。 Is this the only way to go about this? 这是解决这个问题的唯一方法吗? and do you need a gem to upload and unpack zip files? 你需要一个宝石来上传和解压缩zip文件吗?

The only other way i can think of is using a Java Applet or maybe Flash. 我能想到的另一种方式是使用Java Applet或Flash。 I've only seen this functionality implemented with Applets to date. 到目前为止,我只看到了使用Applet实现的这个功能。

UPDATE: Why not use a handy JQuery Plugin: http://www.fyneworks.com/jquery/multiple-file-upload 更新:为什么不使用方便的JQuery插件: http//www.fyneworks.com/jquery/multiple-file-upload

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM