cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <>
Subject Re: Bug in MultipartParser?
Date Fri, 20 Sep 2002 12:28:22 GMT
Ugo Cei wrote:

> 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/, the 
> MultipartParser executes:
> String fileName = new File((String) headers.get("filename")).getName();
> and filename gets to be "", which gets saved as 
> <upload-dir>/ 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.

Try attached patch; tell me how it works.


>     Ugo

View raw message