Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Handling of :filename

git-svn-id: svn://bknr.net/svn/trunk/thirdparty/drakma@4633 4281704c-cde7-0310-8518-8e2dc76b1ff0
  • Loading branch information...
commit 3c04e291a4031a8572b883c8398406d86ef6c7fa 1 parent 9fed1bf
authored January 21, 2011
1  CHANGELOG.txt
... ...
@@ -1,3 +1,4 @@
  1
+Better handling of optional filenames when uploading (Stas Boukarev)
1 2
 Don't funcall symbols that aren't FBOUNDP (Faré Rideau)
2 3
 Allowed disabling of SSL when building (Marko Kocic)
3 4
 
11  request.lisp
@@ -112,10 +112,13 @@ body using the boundary BOUNDARY."
112 112
                       (first value)
113 113
                       (not (stringp (first value))))
114 114
                  (let* ((file-source (first value))
115  
-                        (filename (or (if (functionp file-source) "user-closure")
116  
-                                      (if (streamp file-source) "user-stream")
117  
-                                      (getf (rest value) :filename)
118  
-                                      (file-namestring file-source)))
  115
+                        (filename (or (getf (rest value) :filename)
  116
+                                      (etypecase file-source
  117
+                                        (function "user-closure")
  118
+                                        (file-stream (or (file-namestring file-source)
  119
+                                                         "user-stream"))
  120
+                                        (stream "user-stream")
  121
+                                        (pathname (file-namestring file-source)))))
119 122
                         (content-type (or (getf (rest value) :content-type)
120 123
                                           "application/octet-stream")))
121 124
                    (format stream "; filename=\"~A\"" filename)

0 notes on commit 3c04e29

Please sign in to comment.
Something went wrong with that request. Please try again.