title: How to send a jpeg file as a parameter in a POST request using AlamoFire
body: <p>I am trying to make a server request using Alamofire.
  I need to send a file as a parameter.</p>
  
  <pre><code>    var parameters: [String: AnyObject] = [:]
      parameters["PAYLOAD"] = payloadString // String
      parameters["FINGERPRINT"] = deviceUniqueIdString // String
  </code></pre>
  
  <p>I have a UIImage that I convert to NSData using UIImageJPEGRepresentation()</p>
  
  <pre><code>    let imageData = UIImageJPEGRepresentation(myUIImage, 1.0)
      parameters["IMAGE_FILE"] = imageData
  </code></pre>
  
  <p>Then, I use Alamofire to send the request:</p>
  
  <pre><code>    Alamofire.request(.POST, apiURL, parameters: parameters).responseJSON { response in
  
      }
  </code></pre>
  
  <p>This request works when I only send the payload and fingerprint parameters, but when I include the "IMAGE_FILE" parameter, the server returns error.</p>
  
  <p>How should I send the UIImage?</p>