We had the same problem. There is a already a fixed 
version in the Turbine sources 2.2b that somebody 
made.
--
  Humberto
-----Mensaje original-----
De: C Mason@ Intechtual [mailto:[EMAIL PROTECTED]]
Enviado el: Wednesday, October 17, 2001 11:38 AM
Para: [EMAIL PROTECTED]
Asunto: RE: FileItem - write method error....


I had encountered the same problem with .gif files.  It only occurs in
"in
memory" files.  I traced the problem back to the string encoding
corrupting
the binary data.
Here's my fix:


    public void write(String file) throws Exception
    {
        if (inMemory())
        {
            //FileWriter writer = new FileWriter(file);
            FileOutputStream writer = new FileOutputStream( file );
            //writer.write(getString());
            writer.write( this.get () );
            writer.close();
        }
        else if (storeLocation != null)
        {
            /*
             * The uploaded file is being stored on disk
             * in a temporary location so move it to the
             * desired file.
             */
            if (storeLocation.renameTo(new File(file)) == false)
            {
                throw new Exception(
                    "Cannot write uploaded file to disk!");
            }
        }
        else
        {
            /*
             * For whatever reason we cannot write the
             * file to disk.
             */
            throw new Exception("Cannot write uploaded file to disk!");
        }
    }


Hope this helps,

Chris Mason
[EMAIL PROTECTED]

-----Original Message-----
From: Ling Kok Choon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 17, 2001 6:44 AM
To: [EMAIL PROTECTED]
Subject: FileItem - write method error....


Hi,

   I use turbine upload service to upload file to
server, but i face some error when upload files by
using write method. The error is not consistent, some
files like flash, and picture file will corrupt when
upload to server.

the upload service setting at the
TurbineResuouces.properties is :

services.UploadService.automatic=true

#
# The directory where files will be temporarily
stored.
#
services.UploadService.repository=.

#
# The maximum size of a request that will be
processed.
# 2.5 mb
#
services.UploadService.size.max=2621440
#
# The maximum size of a request that will have it's
elements cached in
# memory by TurbineUploadService class.
#
services.UploadService.size.threshold=10240

Is the setting above valid ?

and the system available physical memory is only
68343K, is it the cause of this error , or others ?


Thank you.

regards,
kok choon


__________________________________________________
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]



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

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

Reply via email to