Skip to content

Commit

Permalink
Handling of :filename
Browse files Browse the repository at this point in the history
git-svn-id: svn://bknr.net/svn/trunk/thirdparty/drakma@4633 4281704c-cde7-0310-8518-8e2dc76b1ff0
  • Loading branch information
edi committed Jan 21, 2011
1 parent 9fed1bf commit 3c04e29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
@@ -1,3 +1,4 @@
Better handling of optional filenames when uploading (Stas Boukarev)
Don't funcall symbols that aren't FBOUNDP (Far� Rideau)
Allowed disabling of SSL when building (Marko Kocic)

Expand Down
11 changes: 7 additions & 4 deletions request.lisp
Expand Up @@ -112,10 +112,13 @@ body using the boundary BOUNDARY."
(first value)
(not (stringp (first value))))
(let* ((file-source (first value))
(filename (or (if (functionp file-source) "user-closure")
(if (streamp file-source) "user-stream")
(getf (rest value) :filename)
(file-namestring file-source)))
(filename (or (getf (rest value) :filename)
(etypecase file-source
(function "user-closure")
(file-stream (or (file-namestring file-source)
"user-stream"))
(stream "user-stream")
(pathname (file-namestring file-source)))))
(content-type (or (getf (rest value) :content-type)
"application/octet-stream")))
(format stream "; filename=\"~A\"" filename)
Expand Down

0 comments on commit 3c04e29

Please sign in to comment.