• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

upload problems jsp

 
marcello marangio
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i am having a very wierd problem in ulpoading large files from a multipart form.
Files are from 20 to 120 Mb large.
The strange thing is that it works perfectly from the local company network (from subnets too) but from far networks (for example from home) the uploaded files result corrupt.
I use tomcat 5.0 and java 1.6; in the jsps I use javazooms fileupload lib, but i've tried with the apache commons upload and simpleframework... same result.
with smaller files it works, but with larger ones it looks a pretty random malfunction.
I tried to increase tomcat's timeouts parameters to 120 min, and I setted up javazoom maxfilesize to an exagerated value too, but still nothing.

any clue is more than welcome.

thanks
Marcello
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the uploaded files result corrupt.


Does that mean you get an exception or that the upload process completes and the file is corrupt ? Are you flushing and closing the outputstream when you are done writing the file ?
 
marcello marangio
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Bala wrote:
the uploaded files result corrupt.


Does that mean you get an exception or that the upload process completes and the file is corrupt ? Are you flushing and closing the outputstream when you are done writing the file ?


i get an exception when I try to use ZipInputStream or ZipFile; it says invalid entrysize or invalid LOC header(bad signature). In the first case the file is readable with winzip or winrar, in the second case it results unreadable.
The files are uploaded via UploadBean library, so I receive the file in a black box, hoping that the library flushes and closes the streams; what I do is instantiating the I/O streams and, yes, i flush and close everything.

thanks
M
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would it be possible to share some client and server side code ?

The random malfunction suggests a stream flushing problem or something to do with network connectivity
 
marcello marangio
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Bala wrote:Would it be possible to share some client and server side code ?

The random malfunction suggests a stream flushing problem or something to do with network connectivity

hi
the jsp code is quite plain:
this the bean setting
<jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
<jsp:setProperty name="upBean" property="filesizelimit" value="999999999" />
<jsp:setProperty name="upBean" property="parser" value="<%= MultipartFormDataRequest.STRUTSPARSER %>"/>
<jsp:setProperty name="upBean" property="parsertmpdir" value="c:/tempUploadBEAN"/>
</jsp:useBean>

and this is more or less the code that stores in the parsetmpdir the temporary file

MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request, null, 999999999);
//here the upload process is over and the file is in a tmp dir
Hashtable files = mrequest.getFiles();
if ( (files != null) || (!files.isEmpty()) ){
UploadFile file = (UploadFile) files.get("coursezipfile");
upBean.setFolderstore(uploadDir);
// here the file is stored in the permanent store, i.e another dir
upBean.store(mrequest,"coursezipfile");
}

the file is stored into a dinamically generated folder.

I believe that it could be a network problem, but I made a test from a internal network that simulates the internet, because it passws through the same firewall of the external connection... so i'm still confused.
Is there some setting in the firewall I have to check or something like that?

thanks
m
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic