Page 1 of 2

Upload started ...Upload failed : java.net.SocketException:

Posted: Tue Apr 06, 2010 12:15 pm
by maarora
Hi,

We are having problem in uploading the large file through jfileupload. On some machine it works fine and when we try to upload from another machine, it throws the below error. Kindly review and suggest.

Upload started ...Upload failed : java.net.SocketException: Software caused connection abort: socket write error

Rergards
Manish

Re: Upload started ...Upload failed : java.net.SocketException:

Posted: Tue Apr 06, 2010 6:41 pm
by support
Are you using FTP or HTTP upload?

Re: Upload started ...Upload failed : java.net.SocketException:

Posted: Wed Apr 07, 2010 6:17 am
by maarora
We are using the HTTP upload. Please check the below js file that we have used in the script for jfileupload.

<!--
var _info = navigator.userAgent;
var _ns = false;
var _ns6 = false;
var sessid="http://www.mydomain.com/admin/process.p ... id').value;
var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
if (_info.indexOf("Opera") > 0) _ie = false;
var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) || (_info.indexOf("IRIX") > 0)));
var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
if (_ie == true) {
document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="250" HEIGHT="250" NAME="fileupload" codebase="http://java.sun.com/update/1.4.2/jinsta ... on=1,4,0,0">');
}
else if (_ns == true && _ns6 == false) {
// BEGIN: Update parameters below for NETSCAPE 3.x and 4.x support.
document.write('<EMBED ');
document.write('type="application/x-java-applet;version=1.4" ');
document.write('CODE="jfileupload.upload.client.MApplet.class" ');
document.write('JAVA_CODEBASE="./" ');
document.write('ARCHIVE="lib/jfileupload.jar,lib/httpimpl.jar,lib/chttpclient.jar,lib/clogging.jar" ');
document.write('NAME="fileupload" ');
document.write('WIDTH="250" ');
document.write('HEIGHT="250" ');
document.write('url="'+sessid+'"')
document.write('paramfile="uploadfile" ');
document.write('param1="todo" ');
document.write('value1="upload" ');
document.write('mode="http" ');
document.write('scriptable=true ');
document.write('<PARAM NAME="chunksize" VALUE="1500000"> <PARAM NAME="chunkmode" VALUE="onfly">');
document.writeln('pluginspage="http://java.sun.com/products/plugin/ind ... "><NOEMBED>');
// END
}
else {
document.writeln('<APPLET CODE="jfileupload.upload.client.MApplet.class" JAVA_CODEBASE="./" ARCHIVE="lib/jfileupload.jar,lib/httpimpl.jar,lib/chttpclient.jar,lib/clogging.jar" WIDTH="250" HEIGHT="250" NAME="fileupload">');
}
// BEGIN: Update parameters below for INTERNET EXPLORER, FIREFOX, SAFARI, OPERA, MOZILLA, NETSCAPE 6+ support.
document.writeln('<PARAM NAME=CODE VALUE="jfileupload.upload.client.MApplet.class">');
document.writeln('<PARAM NAME=CODEBASE VALUE="./">');
document.writeln('<PARAM NAME=ARCHIVE VALUE="lib/jfileupload.jar,lib/httpimpl.jar,lib/chttpclient.jar,lib/clogging.jar">');
document.writeln('<PARAM NAME=NAME VALUE="fileupload">');
document.writeln('<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">');
document.writeln('<PARAM NAME="scriptable" VALUE="true">');
document.writeln('<PARAM NAME="url" VALUE="'+sessid+'">');
document.writeln('<PARAM NAME="paramfile" VALUE="uploadfile">');
document.writeln('<PARAM NAME="param1" VALUE="todo">');
document.writeln('<PARAM NAME="value1" VALUE="upload">');
document.writeln('<PARAM NAME="mode" VALUE="http">');
document.writeln('<PARAM NAME="chunksize" VALUE="1500000"> <PARAM NAME="chunkmode" VALUE="onfly">');
// END
if (_ie == true) {
document.writeln('</OBJECT>');
}
else if (_ns == true && _ns6 == false) {
document.writeln('</NOEMBED></EMBED>');
}
else {
document.writeln('</APPLET>');
}
//-->


Samller file works fine on all computers while larger files gets uploaded only on few computers.

Please suggest.

Regards,
Manish

Re: Upload started ...Upload failed : java.net.SocketException:

Posted: Wed Apr 07, 2010 6:45 am
by support
Are you using PHP as server-side script? PHP has file size limits for upload. Could you check your php.ini?

Re: Upload started ...Upload failed : java.net.SocketException:

Posted: Wed Apr 07, 2010 6:50 am
by maarora
Yes we are using php. But we have defined the chunk size. And larger file works on some computers. We are using 2.4 unregistered version currently.

<PARAM NAME="chunksize" VALUE="1500000"> <PARAM NAME="chunkmode" VALUE="onfly">

Re: Upload started ...Upload failed : java.net.SocketException:

Posted: Wed Apr 07, 2010 11:37 am
by maarora
please suggest if this is related to memroy limit ??? willl it fix the issue if i increase the memory limit in php.ini

Help help help

Regards,
Manish

Re: Upload started ...Upload failed : java.net.SocketException:

Posted: Wed Apr 07, 2010 5:44 pm
by support
What is the file_upload limit in your php.ini. Here are all php.ini you need to check:
- file_uploads
- upload_max_filesize
- post_max_size
- max_execution_time
- max_input_time
- memory_limit

Re: Upload started ...Upload failed : java.net.SocketException:

Posted: Fri Apr 09, 2010 7:08 am
by maarora
Hi,

Please find the below required value. Also, I would like to mention that I am using the chunk size with limit 1500000. It works fine on few system and on other systems it uploads 7-8 chunks then got the error message mentioned above.

- file_uploads = On
- upload_max_filesize = 2M
- post_max_size = 8M
- max_execution_time = 30
- max_input_time = 60
- memory_limit = 32M

I have also tried to add the below lines on the top of the php script.

ini_set("memory_limit","1024M");
set_time_limit(0);

Regards,
Manish

Re: Upload started ...Upload failed : java.net.SocketException:

Posted: Fri Apr 09, 2010 5:19 pm
by support
Do you have IIS or Apache with PHP?

Re: Upload started ...Upload failed : java.net.SocketException:

Posted: Sat Apr 10, 2010 9:49 am
by maarora
Apache with php