def upload_file(file_path):

    global AWS_ACCESS_KEY
    global AWS_SECRET_ACCESS_KEY

    head, tail = os.path.split(file_path)

    bucket = None
    s3 = boto.connect_s3(AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY)
    bucket = s3.get_bucket(KICKFLIP_APP_NAME)  # , validate=False)

    k = Key(bucket)
    head, tail = os.path.split(file_path)
    k.key = KICKFLIP_USER_NAME + "/" + tail

    k.set_contents_from_filename(file_path)
    k.set_acl('public-read')
    if '.m3u8' in file_path:
        print k.generate_url(expires_in=300)

    return k