Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 79685 invoked from network); 28 Jun 2003 18:54:31 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 28 Jun 2003 18:54:31 -0000 Received: (qmail 1172 invoked by uid 97); 28 Jun 2003 18:56:59 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 1165 invoked from network); 28 Jun 2003 18:56:58 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 28 Jun 2003 18:56:58 -0000 Received: (qmail 79391 invoked by uid 500); 28 Jun 2003 18:54:29 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 79380 invoked from network); 28 Jun 2003 18:54:29 -0000 Received: from pproxy107.mbn.or.jp (202.217.3.98) by daedalus.apache.org with SMTP; 28 Jun 2003 18:54:29 -0000 Received: from [192.168.0.3] (csh12-28.pas.mbn.or.jp [202.217.47.124]) by pproxy107.mbn.or.jp (8.11.7+Sun/pproxy107.mbn.or.jp-2.0) with ESMTP id h5SIsUp09760 for ; Sun, 29 Jun 2003 03:54:31 +0900 (JST) Date: Sun, 29 Jun 2003 03:57:41 +0900 From: Tetsuya Kitahata To: "Jakarta Commons Developers List" Subject: Re: [PATH]FileUpload fix for filename for msiexplorer In-Reply-To: <1056822392.12529.43.camel@bluephant> References: <1056822392.12529.43.camel@bluephant> X-Mailer-Plugin: MultiRes Helper for Becky!2 Ver.0.03 Rev.8 Message-Id: <20030629034224.F994.TETSUYA@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.05.11 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N It seems that your [patch] (attachment file) has an extra carriage return CR added: 0D0D0A (CRCRLF: Two ASCII carriage returns and a line feed) instead of 0D0A (CRLF). Needless to say, "diff -u" would make redundant patch because "diff" compares '0D0D0A' and '0D0A'. How did you make this patch? (What kind of tool/editor did you use?) Sincerely, -- Tetsuya (tetsuya@apache.org) P.S. I think recently "0D0D0A"s are scattered here and there in jakarta... --------------------------------------------------------------------- On 28 Jun 2003 13:46:31 -0400 (Subject: [PATH]FileUpload fix for filename for msiexplorer) maciek wrote: > Method getName() in DefaultFileItem.java class when used with > msiexplorer 5/6 returns a filename with the whole client's filesystem > path which creates a problem when you want to save the file on a > server's filesystem. I have chanaged the implementation of the getName() > method to strip the path information from the filename.Below is my > proposed implementation for getName() method: > > public String getName() > { > > if(fileName.lastIndexOf("\\") != -1){ > > return fileName.substring(fileName.lastIndexOf("\\") + 1); > > }else{ > > return fileName; > } > } > > I have attached the fileName_fix_forMSIE.txt patch file. > > I have rebuild the entire source code to create a new jar and tested it > with Tomcat and Resin. It works now with MSIE. A simple call to > item.getName() returns only filename where item is of type FileItem. > > I think that it would be a better idea to change the implementation of > the method without breaking of the FileUpload component interface than > letting web developers to take care of the problem inside a jsp file. > I think users of the component should use the method transparently > without worrying about the possible problem with MSIE with the guarantee > that ONLY filename will be returned from getName() method. > Regards, > Maciej Brodala > > ----------------------------------------------------- Tetsuya Kitahata -- Terra-International, Inc. E-mail: kitahata@bb.mbn.or.jp : tetsuya@apache.org http://www.terra-intl.com/ (Apache Jakarta Translation, Japanese) http://jakarta.terra-intl.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org