-
1. Re: fileUpload: file name differrs in FF and IE
andrei_exadel Apr 28, 2008 4:27 AM (in response to j-pro)Hello,
Yes. This is a known issue. But It won't fixed.
By security reason FF does not send full fileName to server. But IE does.
Anyway we can extract full name on client side in FF, but we can not do it in Opera (It impossible by browser's security). So we can not provide cross-browser implementation in this one.
By the other way we can cut off file name in all browsers, but in this case we restrict functionality that can be usefull, but works only in IE.
So, keep this note in your mind and be ready that filename returned from UploadItem can be different. -
2. Re: fileUpload: file name differrs in FF and IE
egil Apr 28, 2008 7:54 AM (in response to j-pro)Hi, just a pointer on this one. As stated earlier you cannot get Firefox to display the full path of the file. The solution is then to make sure that all browsers yield the same result at least (only the filename with extension).
To do this use:
String filename = new File(uploadedFile.getFileName()).getName();
And use filename as the filename instead of uploadedFile.getFileName()
Works like a charm for me. The only thing you really need is the filename anyway ... -
3. Re: fileUpload: file name differrs in FF and IE
j-pro Apr 29, 2008 10:24 AM (in response to j-pro)Thanks, Andrei, just wanted to know if you plan to change anything. This issue is not a problem for sure, it's ok ;) Thanks.
egil, thanks for suggestion ;)