Hello all, sorry that this is a basic question. I've recently migrated over 
to clojure from php and some features of the language still remain obscure 
to me. I have been following "Web Development with Clojure" (solid intro) 
and have run into a wall with file uploads. The book provides the following 
code to handle uploads: 

(defn handle-upload [{:keys [filename] :as file}]
  (show-upload
   (if (empty? filename)
     "please select a file to upload"

     (try
       (noir.io/upload-file (sb) file :create-path? true)
       (image {:height "150px"}
              (str "/img/" (url-encode filename)))

     (catch Exception ex
       (str "error uploading file " (.getMessage ex)))))))

I would like to know how to generalize this in order to process multiple 
files. In php, this would just be a for-each loop, but I am still searching 
for that loop analogue in clojure. Any help would be great. Thanks. 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to