def upload_dup_file(rest_obj, module):
    """Upload DUP file to OME and get a file token."""
    upload_uri = "UpdateService/Actions/UpdateService.UploadFile"
    headers = {"Content-Type": "application/octet-stream",
               "Accept": "application/octet-stream"}
    upload_success, token = False, None
    dup_file = module.params['dup_file']
    if not isinstance(dup_file, str):
        module.fail_json(
            msg="argument {0} is type of {1} and we were unable to convert to string: {1} cannot be "
                "converted to a string".format("dup_file", type(dup_file)))
    with open(module.params['dup_file'], 'rb') as payload:
        payload = payload.read()
        response = rest_obj.invoke_request("POST", upload_uri, data=payload, headers=headers,
                                           api_timeout=100, dump=False)
        if response.status_code == 200:
            upload_success = True
            token = str(response.json_data)
        else:
            module.fail_json(msg="Unable to upload {0} to {1}".format(module.params['dup_file'],
                                                                      module.params['hostname']))
    return upload_success, token