cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@cbim.it>
Subject Bug in MultipartParser?
Date Fri, 20 Sep 2002 09:31:58 GMT
There is possibly a bug in 
org.apache.cocoon.components.request.multipart.MultipartParser.

Say you have Cocoon running on a Unix server. Send a file from a Unix 
client. The filename is sent as /path/to/file.name, the MultipartParser 
executes:

String fileName = new File((String) headers.get("filename")).getName();

and filename gets to be "file.name", which gets saved as 
<upload-dir>/file.name. All is well.

Now use a Windows client. The filename is sent as C:\PATH\TO\FILE.TXT, 
the call to File.getName() on the Unix server does not know how to parse 
the drive designator and the backslashes and stores thae file as 
<upload-dir>/C:\PATH\TO\FILE.TXT

I'd argue that this is a bug, but I have no idea how to fix it.

	Ugo

-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message