Return-Path: Delivered-To: apmail-cocoon-docs-archive@www.apache.org Received: (qmail 71451 invoked from network); 13 Jul 2005 21:49:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jul 2005 21:49:00 -0000 Received: (qmail 6306 invoked by uid 500); 13 Jul 2005 21:48:59 -0000 Delivered-To: apmail-cocoon-docs-archive@cocoon.apache.org Received: (qmail 6279 invoked by uid 500); 13 Jul 2005 21:48:58 -0000 Mailing-List: contact docs-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: docs@cocoon.apache.org List-Id: Delivered-To: mailing list docs@cocoon.apache.org Received: (qmail 6266 invoked by uid 99); 13 Jul 2005 21:48:58 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2005 14:48:49 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id EEEB814 for ; Wed, 13 Jul 2005 23:48:45 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: docs@cocoon.apache.org Date: Wed, 13 Jul 2005 21:48:45 -0000 Message-ID: <20050713214845.16802.26363@ajax.apache.org> Subject: [Cocoon Wiki] Update of "RecipeUploadUsingAction" by JacobArnold X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dear Wiki user, You have subscribed to a wiki page or wiki category on "Cocoon Wiki" for change notification. The following page has been changed by JacobArnold: http://wiki.apache.org/cocoon/RecipeUploadUsingAction The comment on the change is: Moved stripping of path from FileUploadInfo to FileUploadAction ------------------------------------------------------------------------------ /* - * go thrue form parameters + * go thru form parameters * add to return Map FileUploadInfo object to get informations about * uploaded file */ @@ -548, +548 @@ // do upload flag boolean doUpload = true; + // strip off path (IE for Windows includes it) + String filename = filePart.getUploadName(); + int lastSlash = filename.lastIndexOf('\\'); + filename = uploadedFileName.substring(lastSlash+1); + // set fileinfo - fileInfo.setOriginalFileName(filePart.getUploadName()); + fileInfo.setOriginalFileName(filename); fileInfo.setUploadedFileName(fileInfo.getOriginalFileName()); // define file target @@ -838, +843 @@ * @param uploadedFileName */ public void setUploadedFileName(String uploadedFileName) { - // Type of slash depends on browser's platform, not server platform - int lastSlash = uploadedFileName.lastIndexOf('/'); - if (lastSlash == -1) { - lastSlash = uploadedFileName.lastIndexOf('\\'); - } - this.uploadedFileName = uploadedFileName.substring(lastSlash+1); + this.uploadedFileName = uploadedFileName; } /* (non-Javadoc)