List:MySQL and Java« Previous MessageNext Message »
From:Damir Vukovojac Date:November 7 2003 5:07pm
Subject:Re: File upload/download problem to BLOB field.
View as plain text  
Thanks Russ,

I think that's the answer.

Sorry I am new with MySQL have not realized differant types of blob.

Cheers.


|---------+---------------------------->
|         |           Russ Tennant     |
|         |           <russ@stripped>  |
|         |                            |
|         |           2003-11-07 11:53 |
|         |           AM               |
|         |                            |
|---------+---------------------------->
 
>--------------------------------------------------------------------------------------------------------------|
  |                                                                                       
                      |
  |       To:       "Damir Vukovojac" <damir_vukovojac@stripped>,
java@stripped                        |
  |       cc:                                                                             
                      |
  |       Subject:  Re: File upload/download problem to BLOB field.                       
                      |
 
>--------------------------------------------------------------------------------------------------------------|




On Friday 07 November 2003 10:27 am, Damir Vukovojac wrote:
> Hi
>
> I am trying to store and retrieve files to/from MySQL column of BLOB type
> and it works fine for the files smaller than 64KB. I can upload it and
> when called from download servlet, browser open it in appropriate
> application or prompts me to save it on hard drive.
>
> However if file is bigger than 64K, on upload (when storing to DB) it
> does not complain, but when I try to retrieve it, it is truncated on
> 64KB, and when opening the file it complains that the file is corrupted
> of-course.
>
> The same code when connected to oracle 8i (thin driver)  works fine and I
> was able to store 12MB pdf documents with no problem.
>
> I have tried mysql-connector-java-3.0.9, mysql-connector-java-3.0.5 and
> caucho-jdbc-mysql drivers.
> For upload I am using org.apache.commons.fileupload package from
> jakarta.org
>
> Is there any limitation on those drivers, any problem, or am I doing
> something wrong?
>
>
> Thank you for the help.


Look at the size limitations for the different types in the mysql manual.
You may want to use a mediumblob since a blob is limited to 64K.

--
Russ Tennant
russ@stripped



Thread
File upload/download problem to BLOB field.Damir Vukovojac7 Nov
  • Re: File upload/download problem to BLOB field.Russ Tennant7 Nov
Re: File upload/download problem to BLOB field.Damir Vukovojac7 Nov