Merge pull request #83 from ernstchan/bugfixes

Removed path from upload filenames (if any).
File name truncation done before conversion to HTML entities.