handle file or folder input