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.

        Ugo

-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to