from pathlib import Path


def upload_file(instance):
    """
    Upload a fileStorege object on its media instance path
    """
    dst = instance.upload_to()
    Path(dst).parent.mkdir(parents=True, exist_ok=True)
    return instance.data.save(dst)