Upload image with Alamofire

func callAPIforEditProfile(){
        let fileName : String = String(arc4random()) + "Profile.png"
        Alamofire.upload(multipartFormData: { (multipartFormData) in
            DispatchQueue.main.async {
                multipartFormData.append((AIUser.sharedManager.ID.data(using: String.Encoding.utf8, allowLossyConversion: false))!, withName: "Employer_Id")
                multipartFormData.append(("Employer".data(using: String.Encoding.utf8, allowLossyConversion: false))!, withName: "User_Type")
                multipartFormData.append((self.txtCompanyName.text?.data(using: String.Encoding.utf8, allowLossyConversion: false))!, withName: "Company_Name") 
            }
            if(self.image != UIImage()){
                multipartFormData.append(UIImageJPEGRepresentation(self.image, 0.4) ?? UIImageJPEGRepresentation(UIImage(named: "ic_profile")!, 0.4)!, withName: "Profile", fileName: fileName, mimeType: "image/jpg")
            }
            
        }, to: URL_EDIT_PROFILE, encodingCompletion: { (result) in
            // code
            switch result {
            case .success(request: let upload, streamingFromDisk: _, streamFileURL: _):
                upload.validate().responseJSON {
                    response in
                    HideLoaderOnView()
                    if response.result.isFailure {
                        debugPrint(response)
                    } else {
                        let result = response.value as! NSDictionary
                        print(result)
                        
                    }
                }
            case .failure(let encodingError):
                NSLog((encodingError as NSError).localizedDescription)
            }
        })
        
    }