Return-Path: Delivered-To: apmail-incubator-jspwiki-user-archive@locus.apache.org Received: (qmail 32362 invoked from network); 5 Jun 2008 16:45:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jun 2008 16:45:52 -0000 Received: (qmail 62361 invoked by uid 500); 5 Jun 2008 16:45:55 -0000 Delivered-To: apmail-incubator-jspwiki-user-archive@incubator.apache.org Received: (qmail 62215 invoked by uid 500); 5 Jun 2008 16:45:55 -0000 Mailing-List: contact jspwiki-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-user@incubator.apache.org Delivered-To: mailing list jspwiki-user@incubator.apache.org Received: (qmail 62204 invoked by uid 99); 5 Jun 2008 16:45:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2008 09:45:55 -0700 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WEIRD_PORT,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ramyakgrama@gmail.com designates 74.125.46.153 as permitted sender) Received: from [74.125.46.153] (HELO yw-out-1718.google.com) (74.125.46.153) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2008 16:45:05 +0000 Received: by yw-out-1718.google.com with SMTP id 5so443274ywr.0 for ; Thu, 05 Jun 2008 09:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=tWfwKlqIYoVUatfwk5HdknhguzhorVRwNnZu5c0sVwk=; b=sY/3HALzsDrfINDyaXiUPX0JzevZQykpvNk1jFZO8iXAdkXcKQnvK/ZMvYd88T6XFw zRtuqId28aKpYMlMJpIGZoQys9UWWkzhTUiCoJF4MnqAlQdeE/Aqdzrf+sxk12nSgN3Y jB7F+X5P3JZZ3lUOs/Ckhz84veU7oQfJW0w8M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=dQj4FapeaLiryJlvJ+hzyCTp+NItlBd/UzJFOFht846ovPbkp/grTXPKwJSB8IQBfa 9/cSD/fpFHC1cWjvO/xYTCVlpoaMBmAPt3lDwP7/mpk+xuUoh4L6KM4qXi9nbrAmxHAM 5yC7YeFYGv0rnHShn8yMXLwk38yMPSJAMVvF4= Received: by 10.114.144.1 with SMTP id r1mr1812337wad.97.1212684306408; Thu, 05 Jun 2008 09:45:06 -0700 (PDT) Received: by 10.114.89.15 with HTTP; Thu, 5 Jun 2008 09:45:06 -0700 (PDT) Message-ID: <3976ba360806050945o32a4a4feh225256b8203a69a9@mail.gmail.com> Date: Thu, 5 Jun 2008 12:45:06 -0400 From: "Ramya KGrama" To: jspwiki-user@incubator.apache.org Subject: Re: JSPWiki - Attachments - issue with IE browser In-Reply-To: <383D0349-12F9-4107-9B03-7EA36ED57679@ecyrd.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2117_53048.1212684306410" References: <17654151.post@talk.nabble.com> <3a6c97f00806041225p2dafccfcl693936b46f06a531@mail.gmail.com> <3976ba360806041231g5f9d77dak7d71a8030f9733c8@mail.gmail.com> <383D0349-12F9-4107-9B03-7EA36ED57679@ecyrd.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_2117_53048.1212684306410 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I am using 2.6.2 After looking through the source code, I may have an idea that might work - please correct me if you think otherwise - Make sure that the fileName that gets written into the attachment's properties file is always a relativeName (irrespective of what kind of path the browser returns). To do this, I think in BasicAttachmentProvider.java there is a method putPageProperties(). I would like to parse the value of att.getFileName() to remove any absolute paths and make it relative name just before it writes to the attachment's properties file: - as below: /** * Writes the page properties back to the file system. * Note that it WILL overwrite any previous properties. */ private void putPageProperties( Attachment att, Properties properties ) throws IOException, ProviderException { File attDir = findAttachmentDir( att ); File propertyFile = new File( attDir, PROPERTY_FILE ); OutputStream out = new FileOutputStream( propertyFile ); String attRelativeName = att.getFileName(); int slash = attRelativeName.lastIndexOf("\\"); if (slash != -1) attRelativeName = attRelativeName.substring(slash + 1); slash = attRelativeName.lastIndexOf("/"); if (slash != -1) attRelativeName = attRelativeName.substring(slash + 1); slash = attRelativeName.lastIndexOf(":"); if (slash != -1) attRelativeName = attRelativeName.substring(slash + 1); properties.store( out, " JSPWiki page properties for "+ attRelativeName+ ". DO NOT MODIFY!" ); /* properties.store( out, " JSPWiki page properties for "+ att.getName()+ ". DO NOT MODIFY!" ); */ out.close(); } Am I going in the right direction? I am just hoping this change doesnt have any side effect. Your immediate help is greatly appreciated! I have spent way too much time on this already and havent made ANY progress. Thanks! Ramya On Wed, Jun 4, 2008 at 3:59 PM, Janne Jalkanen wrote: > > Setting it to localhost: is in general a bad idea. Use the full name of > the machine. > > As to the full path name being used, that is fixed in the latest SVN trunk. > I'm actually a bit surprised that you should see it in 2.6, since it's > using a different upload library, the same we've been using for years, and > so far nobody has complained about the same thing. It didn't surface until > we moved to the Apache fileupload library. > > Are you sure you are using 2.6.x instead of 2.7? > > /Janne > > > On Jun 4, 2008, at 22:31 , Ramya KGrama wrote: > > I do have the baseURL set to http://localhost:8888/JSPWiki >> It is the same machine name as localhost. We tried both options. >> >> On Wed, Jun 4, 2008 at 3:25 PM, Harry Metske >> wrote: >> >> You have to configure your baseURL to the value you use in your browser. >>> >>> The case you're describing you use different values, this gives >>> unpredictable results. >>> I think in your case you should configure baseURL= >>> http://chq006103:8888/JSPWiki< >>> http://chq006103:8888/JSPWiki/attach/JSPWiki%20Welcome/C%3A% >>> 5Cinnovatorlille93.jpg >>> >>>> >>>> >>> regards, >>> Harry >>> >>> 2008/6/4 new2Jaas : >>> >>> >>>> Hello, >>>> >>>> We are having issues with uploading and downloading attachments using >>>> JSPWiki using IE browser. >>>> It works perfectly with Netscape/Mozilla/Flock browsers. >>>> jspwiki.properties -> we set the following attributes: >>>> >>>> jspwiki.baseURL = http://localhost:8888/JSPWiki >>>> >>>> jspwiki.referenceStyle=relative >>>> >>>> jspwiki.attachmentProvider =BasicAttachmentProvider >>>> >>>> jspwiki.basicAttachmentProvider.storageDir >>>> =C:\\Data\\jspwiki\\NewJSPWiki >>>> >>>> With the above settings, when using IE browser, it still uses absolute >>>> >>> path >>> >>>> when file is uploaded and shows href'd attachment name with target as: >>>> >>>> >>>> http://chq006103:8888/JSPWiki/attach/JSPWiki%20Welcome/C%3A% >>> 5Cinnovatorlille93.jpg >>> >>>> >>>> Whereas in Mozill and other browsers - it correctly shows href'd >>>> relative >>>> url: >>>> >>>> http://localhost:8888/JSPWiki/attach/JSPWiki%20Welcome/ >>> innovatorlille93.jpg >>> >>>> >>>> When we upload a file, it is uploaded under the full name (the full >>>> absolute >>>> path of the file (from C:\.....)) - only when we use IE >>>> >>> browser. >>> >>>> This does not happen with the other 2 browsers. >>>> Thus, we are unable to download the file. >>>> >>>> Any immediate help is highly appreciated! >>>> >>>> Thanks! >>>> -- >>>> View this message in context: >>>> >>>> http://www.nabble.com/JSPWiki---Attachments---issue-with-IE- >>> browser-tp17654151p17654151.html >>> >>>> Sent from the JspWiki - User mailing list archive at Nabble.com. >>>> >>>> >>>> >>> >>> -- >>> met vriendelijke groet, >>> Harry Metske >>> Telnr. +31-548-512395 >>> Mobile +31-6-51898081 >>> >>> > ------=_Part_2117_53048.1212684306410--