From 37f8a2d7c1c829ec3d225c8932931e3d0e2a85cd Mon Sep 17 00:00:00 2001 From: sostler Date: Fri, 23 Apr 2010 23:23:19 -0400 Subject: Changed upload error handling --- src/site.clj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3-70-g09d2