fixed a bug in the upload class and added more template options for file names
all attributes in the html class will now be html encoded
simpler error handling in dir and f
simpler error handling in dir and f