[seam-commits] Seam SVN: r7299 - trunk/ui/src/main/java/org/jboss/seam/ui/component.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Jan 29 22:34:05 EST 2008


Author: shane.bryzak at jboss.com
Date: 2008-01-29 22:34:05 -0500 (Tue, 29 Jan 2008)
New Revision: 7299

Modified:
   trunk/ui/src/main/java/org/jboss/seam/ui/component/UIFileUpload.java
Log:
JBSEAM-2497

Modified: trunk/ui/src/main/java/org/jboss/seam/ui/component/UIFileUpload.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/component/UIFileUpload.java	2008-01-30 00:54:19 UTC (rev 7298)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/component/UIFileUpload.java	2008-01-30 03:34:05 UTC (rev 7299)
@@ -106,8 +106,23 @@
 
    public void setLocalFileName(String localFileName)
    {
-      this.localFileName = localFileName;
+      this.localFileName = extractFilename(localFileName);
    }
+   
+   /**
+    * Workaround for IE, which includes the full path to the file.
+    */
+   private String extractFilename(String filename)
+   {
+      if (filename != null && filename.lastIndexOf("\\") > -1)
+      {
+         return filename.substring(filename.lastIndexOf("\\") + 1);
+      }
+      else
+      {
+         return filename;
+      }
+   }
 
    public Integer getLocalFileSize()
    {




More information about the seam-commits mailing list