You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Steve Schwarz <sa...@hotmail.com> on 2003/10/17 18:16:09 UTC

FYI - Standalone demo and file uploads

I just ran across this and thought it might help someone else...

If you are using the standalone demo Jetty servlet where it creates its temp 
files (and consequently it's upload directory) on a different file system 
from the cocoon deployment AND your File Upload Action naively uses 
File.renameTo() to copy the file to its final resting place File.renameTo() 
can fail. According to the Java spec this behavior is platform specific; 
this stands to reason since internally the rename probably just updates some 
filesystem pointers within the filesystem table/FAT, which it can't do if 
the file is destined for a different filesystem.

I saw this behavior using the standalone demo on my dev Linux machine since 
Jetty writes to /tmp/Jetty_ etc and my cocoon install is in /home on a 
different filesystem.

Anyway, to make a long story short, if this is an issue for anyone else you 
can change the action to try the rename and then do a copy if the rename 
fails.

Best regards,
Steve

_________________________________________________________________
Never get a busy signal because you are always connected  with high-speed 
Internet access. Click here to comparison-shop providers.  
https://broadband.msn.com


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