Categories
Java

Jakarta Commons FileUpload and file names

File this under argh!

We use the Jakrata Commons FileUpload to manage J2EE’s weakest link – file uploads.
So naturally, like an narrow-minded developer I test the functionality with Firefox and voila, the upload works. Wrong, and in a beautiful fashion it is the client who finds this out. It appears that Internet Explorer provides the path name for a file being uploaded differently than Firefox does. That is because when you ask FileUpload’s FileItem getName() method for the file’s name what you get is:
Firefox: filename.xyz
IE: C:\firstdir\another directory\more directory\you get the idea\filename.xyz

Beware!

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Share