def upload_chunk(url, dat, start, stop, total, content_type, session):
    """Upload a chunk of a file"""
    res = session.put(url=url, data=dat, headers={'Content-Length': str(
        stop - start), 'Content-Type': content_type, 'Content-Range':
        'bytes {start}-{stop}/{total}'.format(start=start, stop=stop - 1,
        total=total)})
    return res
