Subject: Re: [dav-dev] Ampersands in file problem using win2k

From: Greg Stein <[email-masked]>
Date: Sat, 10 Feb 2001 02:09:06 -0800

On Fri, Feb 09, 2001 at 11:35:02PM -0800, Joachim Feise wrote:
> Dennis Craig wrote:
> > 
> > Has anyone experienced truncating of filenames when viewing files though
> > win2k web folders?
> > 
> > A user has a filename with an ampersand on the server and windows
> > truncates it all the way to the ampersand.
> > 
> > ex: file on server: my_dog_&_cat.txt
> >     file on windows: my_dog_
> > 
> > Hence the above is seen as an unknown file type and theres also a file
> > not found error when any manipulation of that file is attempted.
> 
> This seems to be a problem with the Microsoft XML parser.
> I get a similar problem in DAV Explorer, which uses an early version of
> the MS parser.
> It seems that the parser doesn't like the &amp; which the server sends.
> Running DAV Explorer in the debugger, I actually get two <href> tags, one with
> the part before the ampersand, the other one with the part following it.

I was about to ask "which server are you talking to?" because I knew mod_dav
returned the values appropriately. Didn't figure on a client problem :-)

The other possibility is that I'm mistaken in assuming that &amp; is the
correct substitution for an ampersand in an <href> element. I could see an
argument being made that the URL should be encoded using %26 for the
ampersand.

I'm copying the main WebDAV mailing list for feedback on this point.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---

From: John Stracke <[email-masked]>
Date: Mon, 12 Feb 2001 11:47:22 -0500

> argument being made that the URL should be encoded using %26 for the

That sounds worth a try, at least, since HTTP URLs generally don't have & in the
filename part of the URL.  Using the &amp; encoding means that it'll be protected
from the XML parser, but then the application will see an & in the filename.

--
/=================================================================\
|John Stracke    | http://www.ecal.com |My opinions are my own.   |
|Chief Scientist |================================================|
|eCal Corp.      |I'm not imaginary. I'm ontologically challenged.|
[email-masked]|                                                |
\=================================================================/