Added support for folder or file selection