问题
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