可以使用 CarrierWave 上传器从不同的目录上传文件吗?

Can a CarrierWave uploader be used to upload files from different directories?

我正在寻找 CarrierWave 的特定工作流程,但我找不到相关示例。我想允许用户 select 从多个目录位置上传文件。

这里描述了我能找到的最接近的例子:Rails 4 multiple image or file upload using carrierwave. The difference between this functionality and what I want is rather than allowing a user to select multiple files from the same directory, I would like them to be able to select a file then re-open the file upload dialog and select another file from a separate directory. The CarrierWave documentation同样只提到从同一目录上传多个文件。 CarrierWave 可以做到这一点吗?

可能的解决方案:根据我在this post中的发现,似乎process方法可以在上传文件时立即用于运行代码。使用此方法保存文件或将其添加到要保存的文件数组中是否合适?

不是 CarrierWare 的问题。这是 HTML 和浏览器的限制。

您需要使用 javascript 库来 select 多个文件。像这样https://blueimp.github.io/jQuery-File-Upload/ or http://www.dropzonejs.com/