. Correct fix for UTF-8 filename upload issue: AWC-497

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2452 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-02-20 13:35:38 +00:00
parent 1b99b353eb
commit d8992c396f
2 changed files with 5 additions and 4 deletions

View File

@@ -75,6 +75,10 @@ public class UploadFileServlet extends BaseServlet
HttpSession session = request.getSession();
ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory());
// ensure that the encoding is handled correctly
upload.setHeaderEncoding("UTF-8");
List<FileItem> fileItems = upload.parseRequest(request);
Iterator<FileItem> iter = fileItems.iterator();
@@ -94,9 +98,6 @@ public class UploadFileServlet extends BaseServlet
String filename = item.getName();
if (filename != null && filename.length() != 0)
{
// ensure that the encoding is handled correctly
filename = new String(filename.getBytes(), "UTF8").toString();
if (logger.isDebugEnabled())
logger.debug("Processing uploaded file: " + filename);