diff options
author | netconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-08-27 07:02:57 +0000 |
---|---|---|
committer | netconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-08-27 07:02:57 +0000 |
commit | 20e23aa9edcae9b5d087f369c76831ec1b60dc13 (patch) | |
tree | c7eb97d7afafef70eb1f028b643c1570a71dbd98 /src/main/java/at/gv/egiz | |
parent | 60432098ad277b27d6ca842d4594a3fe2d4f5024 (diff) | |
download | pdf-as-3-20e23aa9edcae9b5d087f369c76831ec1b60dc13.tar.gz pdf-as-3-20e23aa9edcae9b5d087f369c76831ec1b60dc13.tar.bz2 pdf-as-3-20e23aa9edcae9b5d087f369c76831ec1b60dc13.zip |
bugfix "IE 6/7 upload"
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@200 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz')
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/web/helper/TempDirHelper.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/web/helper/TempDirHelper.java b/src/main/java/at/gv/egiz/pdfas/web/helper/TempDirHelper.java index 9f2b6fb..0745bcc 100644 --- a/src/main/java/at/gv/egiz/pdfas/web/helper/TempDirHelper.java +++ b/src/main/java/at/gv/egiz/pdfas/web/helper/TempDirHelper.java @@ -149,6 +149,8 @@ public class TempDirHelper protected static String formatFileName(String fileNameSuffix)
{
+ // double check so that file name is always correct.
+ fileNameSuffix = extractFileNameSuffix(fileNameSuffix);
String fileName = "tmp" + formatIndex(runningIndex) + "_" + fileNameSuffix;
runningIndex++;
@@ -239,4 +241,14 @@ public class TempDirHelper }
}
+ /**
+ * Given a file (maybe with path), extracts the file name suffix.
+ * @param file The file and maybe path.
+ * @return Returns the file name.
+ */
+ public static String extractFileNameSuffix (String file)
+ {
+ File f = new File(file);
+ return f.getName();
+ }
}
|