def METHOD_NAME(stored_file_meta: StorageFileMetaData) -> File:
    # extracts fields from api/{file_id}/{filename}
    match = _FILE_ID_PATTERN.match(stored_file_meta.file_id or "")
    if not match:
        msg = f"Invalid file_id {stored_file_meta.file_id} in file metadata"
        raise ValueError(msg)
    file_id, filename = match.groups()
    return File(
        id=file_id,  # type: ignore
        filename=filename,
        content_type=guess_type(filename)[0] or "application/octet-stream",
        checksum=stored_file_meta.entity_tag,
    )