title: How to save user profile image using Alamofire to MYSQL database then retrieve on the following screen
body: <p>I am creating a user profile and I would like to save the user's image to my MYSQL database. originally, I was saving the user's Gender, birthday &amp; relationship status to the User class, however I have decided to add a user profile image. That additional code is below:</p>
  
  <pre><code>  func updateUser(UserGender: String, UserBirthday: Date, UserStats: String, UserImage: UIImage, completion: @escaping (String?, String?) -&gt; Void) {
      let dicParams = [
          "user_gender"   : UserGender,
          "user_birthday" : UserBirthday,
          "user_stats"    : UserStats,
          "user_image"    : UserImage
          ] as [String : Any]
  
      Alamofire.request("\(Constants.Server.URL)/users",
          method: .put,
          parameters: dicParams,
          headers: header)
          .validate()
          .responseJSON { (response) in
              switch response.result {
              case .success(let value as [String: String]):
                  completion(value[Constants.Server.RESPONSE_MESSAGE], nil)
              case .failure(_):
                  completion(nil, self.getErrorString(ErrorData: response.data!))
              default:
                  completion(nil, "Unkown Error")
              }
      }
  }
  </code></pre>
  
  <p>I am curious since it is an image if I need to use UIImageJPEGRepresentation or include any additional information in the request, or when I call it on the following screen to fill a UIImageView to wrap it as UIImage object. Any help would be much appreciated.</p>