You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hugo Villeneuve <hv...@b-wax.com> on 2002/11/13 20:20:30 UTC

Getting corrupted files using multipart and FormFile .

 Hello,

I have some corrupted file problem with Struts, in upload and in download.

1- Upload :  I use the FormFile object and the <html:file> tag to import
file from the client browser. Things works just fine with almost every files
but I have hit some files ( like tiff and pdf) that get corrupted after the
upload. The files are the same size but the checksum is different (tiff
reader and Adobe can not read the files after upload). Why I say it is
struts and not Tomcat : I did a test in the same Struts Action but using a
packages form Oreilly to parse multipart request. The file gets uploaded
correctly using Oreilly stuff. Any comments will be welcome.


2- Dowload : I have a Struts Action that send files to the client browser.
Avery thing works just fine but “once in a while” the client will get a
corrupted PDF. We know the problem is not with the pdf but during the
transfer of the file. It could be Struts, Tomcat or Adobe (I know the
Acrobat Reader ActiveX is in charge of downloading the PDF on the client
side). Can Struts be the problem ?

Any discussion will be welcome.

My System:
- Win NT
- Tomcat 3.2
- Struts 1.0
- JDK 1.2

Thank you.
Hugo

Re: Getting corrupted files using multipart and FormFile .

Posted by Martin Cooper <ma...@apache.org>.

On Wed, 13 Nov 2002, Hugo Villeneuve wrote:

>  Hello,
>
> I have some corrupted file problem with Struts, in upload and in download.
>
> 1- Upload :  I use the FormFile object and the <html:file> tag to import
> file from the client browser. Things works just fine with almost every files
> but I have hit some files ( like tiff and pdf) that get corrupted after the
> upload. The files are the same size but the checksum is different (tiff
> reader and Adobe can not read the files after upload). Why I say it is
> struts and not Tomcat : I did a test in the same Struts Action but using a
> packages form Oreilly to parse multipart request. The file gets uploaded
> correctly using Oreilly stuff. Any comments will be welcome.

These types of problems have been fixed for Struts 1.1, using a new file
upload implementation. I would strongly recommend that you pick up 1.1-b2
or a later nightly build.

 >
>
> 2- Dowload : I have a Struts Action that send files to the client browser.
> Avery thing works just fine but �once in a while� the client will get a
> corrupted PDF. We know the problem is not with the pdf but during the
> transfer of the file. It could be Struts, Tomcat or Adobe (I know the
> Acrobat Reader ActiveX is in charge of downloading the PDF on the client
> side). Can Struts be the problem ?

I think it's very unlikely that Struts is involved in this in any way.
Your action, remember, is what is sending the file to the client, not
Struts code. It's much more likely that your action has a problem, perhaps
related to using a writer which will transform the content, or specifying
an incorrect content type for the download.

--
Martin Cooper


>
> Any discussion will be welcome.
>
> My System:
> - Win NT
> - Tomcat 3.2
> - Struts 1.0
> - JDK 1.2
>
> Thank you.
> Hugo
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>