如何在Phoenix中获取file_path?

问题描述

 <form phx-submit="ff">
   <input type="file" name="ff" id="input" multiple>
   <button type="submit"> FF </button>
 </form> 

        
    
 def handle_event("ff",%{"ff" => ff},socket) do
   IO.inspect(ff,label: "FF:")
   {:noreply,socket}
 end

我尝试了上面的代码。但是,当我们执行IO.inspect(ff)时,它将给出[object File]。 我们如何获取文件的路径(如struct / map / string)?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)