cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: Bug in MultipartParser?
Date Fri, 20 Sep 2002 13:39:19 GMT
Ugo Cei wrote:

> Vadim Gritsenko wrote:
>
>> +            String fileName = (String) headers.get("filename");
>> +            if(File.separatorChar == '\\')
>> +                fileName = fileName.replace('/','\\');
>> +            else
>> +                fileName = fileName.replace('\\','/');
>
>
> Looks like it should work most of the time. I'm afraid that it doesn't 
> cover pathological cases like having a Unix file with an \ embedded in 
> the filename sent to a Windows machine, or some bizarre OS where path 
> separators are maybe colons or dots. OTOH I'm afraid it's not possible 
> to devise a solution that works 100% of the time.


Worst case result is wrongly named file, which is hardly important, 
especially when taking in account automatic renaming of duplicate names.

In any case, does it work? If yes, I can commit...

Vadim



>     Ugo



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


Mime
View raw message