<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def upload(config, remote_loc, u_filename):
 """Upload the files"""

    rcode = False
    try:
        sftp, transport = get_sftp_conn(config)
        remote_dir = get_remote_path(remote_loc)
        for part in ['sha1', 'asc']:
            local_file = '%s.%s' % (u_filename, part)
            remote_file = os.path.join(remote_dir, local_file)
            sftp.put(local_file, remote_file)
        sftp.put(remote_dir, os.path.join(remote_dir, u_filename))
        rcode = True
    except BaseException:
        pass
    finally:
        if 'transport' in locals():
            transport.close()
    return rcode