为了上传文件到我正在写的Clojure服务器,我需要一个客户端表单,看起来像这样:
<form action="/file" method="post" enctype="multipart/form-data">
<input name="file" type="file" size="20" />
<input type="submit" name="submit" value="submit" />
但是我找不到有关Hiccup或Compojure创建此类表单的文档。我手头的样例看起来像这样:
[:h2 "Choose a file to upload"]
:form {:method "post" :action "/upload"}
[:input.math {:type "text" :name "a"}] [:span.math " + "]
[:input.math {:type "text" :name "b"}] [:br]
我的问题是在哪里可以找到文档,了解如何修改以创建一个可以上传文件的表单?
[:span#my_id.class1.class2 ...]
等同于[:span {:id "my_id" :class "class1 class2"} ...]
。 - Nicolas Buduroi