Alamofire 4 upload with parameters
<p>I'm doing the below to upload a PNG file with parameters:</p>

<pre><code>    Alamofire.upload(
        multipartFormData: { multipartFormData in
            multipartFormData.append(UIImagePNGRepresentation(tempImage!)!, withName: "file", fileName: "picture.png", mimeType: "image/png")

            // Send parameters
            multipartFormData.append((UserDefaults.standard.value(forKey: Email) as! String).data(using: .utf8)!, withName: "email")
            multipartFormData.append("png".data(using: .utf8)!, withName: "type")

        },
        to: "user/picture",
        encodingCompletion: { encodingResult in
            switch encodingResult {
            case .success(let upload, _, _):
                upload.responseJSON { response in
                    debugPrint("SUCCESS RESPONSE: \(response)")
                }
            case .failure(let encodingError):
                self.removeSpinnerFromView()
                print("ERROR RESPONSE: \(encodingError)")

            }
        }
    )
</code></pre>

<p>Problem is that on my server I don't see the <code>email</code> and <code>type</code> form fields. I followed examples posted online for this. Is there anything I should do differently for this?</p>

<p><strong>EDIT</strong></p>

<p>If I remove the part where I put:</p>

<pre><code>multipartFormData.append(UIImagePNGRepresentation(tempImage!)!, withName: "file", fileName: "picture.png", mimeType: "image/png")
</code></pre>

<p>THEN the parameters are included. Otherwise not, I think this is a bug in Alamofire 4.0.1.</p>