From 788b4e4f7a97a67908bc09662afaff88f3c06666 Mon Sep 17 00:00:00 2001 From: Marcus Smith Date: Fri, 18 Nov 2016 14:14:02 -0500 Subject: [PATCH] Remove File data from upload's query parameters, which was preventing a proper URL from being created from the request string --- SlackKit/Sources/WebAPI.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SlackKit/Sources/WebAPI.swift b/SlackKit/Sources/WebAPI.swift index dce2305..6b9da2d 100644 --- a/SlackKit/Sources/WebAPI.swift +++ b/SlackKit/Sources/WebAPI.swift @@ -316,7 +316,7 @@ public final class WebAPI { } public func uploadFile(_ file: Data, filename: String, filetype: String = "auto", title: String? = nil, initialComment: String? = nil, channels: [String]? = nil, success: ((_ file: File)->Void)?, failure: FailureClosure?) { - let parameters: [String: Any?] = ["file": file, "filename": filename, "filetype": filetype, "title": title, "initial_comment": initialComment, "channels": channels?.joined(separator: ",")] + let parameters: [String: Any?] = ["filename": filename, "filetype": filetype, "title": title, "initial_comment": initialComment, "channels": channels?.joined(separator: ",")] networkInterface.uploadRequest(token, data: file, parameters: WebAPI.filterNilParameters(parameters), successClosure: { (response) -> Void in success?(File(file: response["file"] as? [String: Any]))