please help me... i want to upload huge file...

hi every one....

I'm a new and member betwenn you...

and the only Java programer in my country...

now, i try to create a web page.. for uploading about 5MB byte file, via HTML Form....

but when, i did the uploading web page, for small size files, (upto 2 MB)

but when i want to upload a huge file, it shows me a message asking me increase Max file size,, but i dont know how can i do it?

for more information, i did it by Native JSP and Java, using MySQL Database, as i want to add the file to MEDIUMBLOB data type,,, using Tomcat 6.0 Web server...

thanks very much....

[620 byte] By [amanjpro@yahoo.coma] at [2007-11-27 8:26:04]
# 1

which country are you in?

anyway, i think this is a tomcat issue. In your tomcat/conf directory look for your server.xml file and find the <Connector....> tag for your project. Make sure you find the right one and then set the maxPostSize parameter (in bytes). It defaults to 2097152 (2 megabytes). Increase it to whatever size you need.

Let me know how it goes, good luck!

den2681a at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Dear den...i try to do it... but i didnt find it...i foundd connector tag... but it was not able to find it...i dont know what is wrong there.... :(By the way i'm from Kurdisan/ the iraqi Kurdistan...
amanjpro@yahoo.coma at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Ok, in your tomcat installation directory can you find the conf directory? In there you should see a server.xml file.

Inside you will have a <Connector...> tag defined that your application uses. For instance, mine looks like...

<Connector port="80"

maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

enableLookups="false" redirectPort="8443" acceptCount="100"

debug="0" connectionTimeout="20000"

disableUploadTimeout="true" />

So, the change you want to make is to add another parameter to it like so...

<Connector port="80"

maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

enableLookups="false" redirectPort="8443" acceptCount="100"

debug="0" connectionTimeout="20000"

disableUploadTimeout="true" maxPostSize="6000000"/>

Let me know how it goes...

den2681a at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
dear, den...i disturbed you with my self... sorry...i found server.xml file, as i found connector tag too, but it was not with these attributes...can i just copy it and paste in my server.xml file? thanks again and again
amanjpro@yahoo.coma at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
that's OK if it doesn't look exactly like mine, just make sure you add that maxPostSize part that I added.how many <Connector...> tags do you have in yours? Can you copy them in here for me to see?
den2681a at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

<!--The connectors can use a shared executor, you can define one or more named thread pools-->

<!--

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"

maxThreads="150" minSpareThreads="4"/>

-->

<!-- A "Connector" represents an endpoint by which requests are received

and responses are returned. Documentation at :

Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)

Java AJP Connector: /docs/config/ajp.html

APR (HTTP/AJP) Connector: /docs/apr.html

Define a non-SSL HTTP/1.1 Connector on port 8080

-->

<Connector port="8080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443" />

<!-- A "Connector" using the shared thread pool-->

<!--

<Connector executor="tomcatThreadPool"

port="8080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443" />

-->

<!-- Define a SSL HTTP/1.1 Connector on port 8443

This connector uses the JSSE configuration, when using APR, the

connector should be using the OpenSSL style configuration

described in the APR documentation -->

<!--

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"

maxThreads="150" scheme="https" secure="true"

clientAuth="false" sslProtocol="TLS" />

-->

<!-- Define an AJP 1.3 Connector on port 8009 -->

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

this is the exat server.xml (Connector part)

thank you again my den

amanjpro@yahoo.coma at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

ok well i'm not totally sure which one your site is actually using (and in fact you might be using mutliple entries in there) so to be safe, i would say you should add that maxPostSize to each one of those <Connector....> tags like I did in my earlier example.

Try that and let me know if you are still having problems.

den2681a at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
dear den...i copied it, as u mentioned in all Connector tags, but it still has a problem...for more information, my Tomcat version is 6.0...i'm waiting for ur reply...thx, again
amanjpro@yahoo.coma at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9
can you post the full error message you are getting? if you are getting a java stack trace please copy the whole thing in here for us to look at.
den2681a at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10

com.mysql.jdbc.PacketTooBigException: Packet for query is too large (2658422 > 1048576).

You can change this value on the server by setting the max_allowed_packet' variable.

this is an error message, as i think it is related to Connector/j, for more information, i'm using version 3.2....

thanks again dear den...

yours, Amanj MM

Message was edited by:

amanjpro@yahoo.com

amanjpro@yahoo.coma at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 11
dear den.. this is my result..i hope u help me...yours, Amanj MM
amanjpro@yahoo.coma at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 12
HELP HELP i'm waiting for ur answers...
amanjpro@yahoo.coma at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 13
did you look at the error message? it doesn't appear to be a struts problem, this is a database issue.in fact, that error message is telling you how to fix the issue. do you still not understand?
den2681a at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 14
dear den.. i tried to find where i can change this value on my server... but i never find it...for more info....i'm using Connector/J 3.0
amanjpro@yahoo.coma at 2007-7-12 20:15:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 15

if you Google that error you can see it's a MySQL parameter that you need to update.

This page has some info that should help.... looks like your default is set to 1 MB though, but the fix should be the same.

Let me know...

http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html

den2681a at 2007-7-21 22:40:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 16
thank you den...now i know what should i do...thanks againyours, Amanj MM
amanjpro@yahoo.coma at 2007-7-21 22:40:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...