summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsostler <sbostler@gmail.com>2010-04-23 23:23:19 -0400
committersostler <sbostler@gmail.com>2010-04-23 23:23:19 -0400
commit37f8a2d7c1c829ec3d225c8932931e3d0e2a85cd (patch)
tree516b959b7a29237b662b46200615108104746d1f /src
parent4bf18f0771162cd7618851bf5a5126d9666b6750 (diff)
Changed upload error handling
Diffstat (limited to 'src')
-rw-r--r--src/site.clj7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/site.clj b/src/site.clj
index 3a8ecd3..c06b194 100644
--- a/src/site.clj
+++ b/src/site.clj
@@ -856,10 +856,13 @@
(or (is-file-too-big? f vip)
(is-image-invalid? f)))
-; TODO:
+
+; Upload notes:
; The webcam code doesn't feature an error handler,
; so all upload responses not equal to "OK" are considered
; errors.
+; The upload code doesn't use jQuery.ajax, and doesn't JSON-eval
+; responses. Therefore, return strings should not be JSON-encoded.
(defn do-upload [session image room]
(if-let [err (validate-upload-file (image :tempfile) (is-vip? session))]
@@ -874,7 +877,7 @@
(dosync
(add-message msg room))
(copy (:tempfile image) dest)
- (resp-success "OK")))))
+ [200 "OK"]))))
(defn upload [session params]
(let [room-key (params :room)