How to upload a folder using Activestorage while maintaining original folder structure

99封情书 提交于 2020-01-06 04:34:25

问题


I am looking for a way to upload whole folder using activestorage using its direct_upload feature but I am not able to retrieve file's relative path(webkitRelativePath) on rails end so that I can create exact same structure on S3 or on local disk.

Here the code I am using

 <%= form_tag('/action', method: "post", id:"myForm") do %>
  <%= file_field_tag(:file, webkitdirectory: '', directory: '', multiple: true, direct_upload: true) %>
  <%= submit_tag("Submit", id:"submit_btn") %>
<% end %>

Any help/suggestion greatly appreciated.

来源:https://stackoverflow.com/questions/49852567/how-to-upload-a-folder-using-activestorage-while-maintaining-original-folder-str

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