Problem while uploading file from remote client using servlet!

M

Madni

Dear All,

I am using an upload utility which works very well if i test it using
single machine making it work both as client and server. But while i
was trying to upload ,relatively bigger file (50 mb),over a LAN it
throws exception randomly(sometimes it works and sometimes not ) .
Consider following lines of code :

public void doPost(HttpServletRequest req, HttpServletResponse res)
throws
ServletException, IOException {

//.......................................................
//...................................................... some code here


try {
UploadRead obj = new UploadRead(req,
strProjPath,req.getContentLength());
//UploadRead(HttpServletRequest,String,int);
//..........................................................
//.......................................................... remaining
code

exception is thrown soon as it strats with UploadRead instantiation
.......
When i replaced req.getContentLength() with some hard coded figure
(like 209715200 which is 200 MB) ... it works well with the remote
client upload operation.

can anyone please guide me in this ...

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top