on 8/23/01 7:41 AM, "Paal Hagerup" <[EMAIL PROTECTED]> wrote:
> 2.1 have a bug in FileItem.write().
>
> Here is a workaround:
>
> FileItem file = pp.getFileItem( "fileName" );
> if (file.inMemory())
> {
> FileWriter writer = new FileWriter( destination );
> writer.write( file.getString() );
> writer.close(); // Missing in FileItem.writer()
> }
> else
> {
> file.write( destination );
> }
>
> If I only knew how to make a patch I would submit one...
>
> Paal Hagerup
This has now been fixed in the DefaultFileItem.java in
jakarta-turbine-fulcrum
Thanks.
FYI, you should wrap the above in a try/finally so that you can be assured
it is closed if the write fails for some reason.
-jon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]