Hey Armando I copied and executed you program..It's fine upto listing the contents of directory.But when you start downloading file instead of the actual-path i.e"c:/files/err" it's taking http://server/servlet-name/cgi-bin/<file-to-download>
This can be resolved by coding the actual path in the script as