Added support for files and for handling URL.