my dog learned polymorphism*
The moose likes Other Open Source Projects and the fly likes upload problems jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "upload problems jsp" Watch "upload problems jsp" New topic
Author

upload problems jsp

marcello marangio
Greenhorn

Joined: Nov 26, 2010
Posts: 8
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

Joined: Feb 24, 2006
Posts: 6661
    
    5

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 ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
marcello marangio
Greenhorn

Joined: Nov 26, 2010
Posts: 8
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

Joined: Feb 24, 2006
Posts: 6661
    
    5

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

Joined: Nov 26, 2010
Posts: 8
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: upload problems jsp