Thanks I used the suggested code in my Action instead
of altering FileItem (not sure which I was supposed to
do).  It now writes the file to disk, however the gif
is garbaged.  Is this a problem with proprietary file
types?  I've pasted the code below.

I did a diff on the UploadFile and the DownloadFile. 
They differ...
$ diff nav_next.gif private/nav_next.gif
Binary files nav_next.gif and private/nav_next.gif
differ


Thanks in advance,
Terry


 FileWriter writer = null;
            try
            {
                writer = new FileWriter(fullPath +
filename);
                writer.write(fileItem.getString());
            }
            catch (Exception e) {
                        e.printStackTrace();
            }
            finally
            {
                if (writer != null)
                {
                    writer.close();
                }
            }


--- Daniel Rall <[EMAIL PROTECTED]> wrote:
> This is fixed in both 2.x and 3.x CVS.
> 
>             try
>             {
>                 writer = new FileWriter(file);
>                 writer.write(getString());
>             }
>             finally
>             {
>                 if (writer != null)
>                 {
>                     writer.close();
>                 }
>             }
> 
> See http://jakarta.apache.org/site/source.html for
> how to submit
> patches in the future.
> 
> 
> Terry McBride <[EMAIL PROTECTED]> writes:
> 
> > I have a problem with uploaded gif (or *.doc)
> files
> > having size zero but jpg or tif are fine.  I
> consulted
> > the archive. I found the thread below explaining
> the
> > same problem, a work around, and a fix notice
> (which I
> > don't experience - probably not supposed to yet
> :).  I
> > tried the workaround in the archive.  I also
> looked
> > through the turbine and fulcrum source code but I
> > don't see how content-type in FileItem could cause
> > this problem.
> >
> > Is the problem caused by the content-type?  Why? 
> I'm
> > trying to understand what's going on.
> >
> >
> > <I found these in the mailing list archive>
> >
> > 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...
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


=====
"I'm concerned about a better world. I'm concerned about justice; I'm concerned about 
brotherhood; I'm concerned about truth. And when one is concerned about that, he can 
never advocate violence. For through violence you may murder a murderer, but you can't 
murder murder. Through violence you may murder a liar, but you can't establish truth. 
Through violence you may murder a hater, but you can't murder hate through violence. 
Darkness cannot put out darkness; only light can do that."

-M. L. King, Jr., 16 August 1967

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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

Reply via email to