Phoenix file upload documentation

def upload_route(conn, params) do
  # multipart/form-data - <input type="file" name="media">
  # don't forget the csrf
  if upload = params["media"] do
      # upload.path is a real file, and will be removed after request finish
      # do File.cp before conn call
      File.cp(upload.path, upload.filename) # your phoenix project dir
  end
end

yeah, just like that :smiley:

4 Likes