def METHOD_NAME(self, *args, **options):
    fname = options['fname']
    fname = os.path.abspath(fname) if fname else ''
    directory = options['dir']
    directory = os.path.abspath(directory) if directory else ''
    if fname:
        upload(fname=fname)
    fnames = os.listdir(directory) if directory else []
    for fname in fnames:
        fname = os.path.join(directory, fname)
        upload(fname=fname)