Re: upload images / mp3 more Than 1 MB capacity ---- please help

2005-10-15 Thread DreamWerx
For an PHP example of how to import data getting around
max_packet_size, performance, etc. issues..  Be sure to read this
article.
Also linked from: http://dev.mysql.com/doc/refman/4.1/en/blob.html

Article @ http://php.dreamwerx.net/forums/viewtopic.php?t=6

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: upload images / mp3 more Than 1 MB capacity ---- please help

2005-10-14 Thread Jigal van Hemert

Dan Buettner wrote:
I tend to disagree - at my place of employment, a newspaper, we have 
hundreds of gigabytes of BLOB data (ad and page layouts  digital 
artwork) stored in SQL databases.  Granted we are using Sybase for that 
and not MySQL but there are a lot of advantages to it - access control, 
change control and tracking, easy insertion and deletion, and access 
from any client right through the database driver so you can repurpose 
content more easily.


There are situations where it might be useful to store large amounts of 
binary data in a database. For most situations the best solution is to 
store metadata about the file in a database and store the file itself on 
a file system.
There have been lots of discussions about it on this list in the past. 
From those discussions one could conclude that in general a file system 
is best for storing (large) files and the metadata about these files can 
live in a database. But there are situations where storing large files 
in a database has more advantages.


Kind regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



upload images / mp3 more Than 1 MB capacity ---- please help

2005-10-13 Thread Kane Wilson
hi , 
 
I have crerated a mysql database to store images , mp3 , video files..etc. In 
my first stage i stored images as jpg , gif . 
But when i try to store little but huge gif files it wont store . I used the 
script as follows to upload images, 
 
html
head
titleUpload File To MySQL Database/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
style type=text/css
!--
.box {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
border: 1px solid #00;
}
--
/style
/head
body
?
if(isset($_POST['upload']))
{
$fileName = $_FILES['userfile']['name'];
$tmpName  = $_FILES['userfile']['tmp_name'];
$fileType = $_FILES['userfile']['type'];
$fileSize = $_FILES['userfile']['size'];
$fp = fopen($tmpName, 'r');
$content = fread($fp, $fileSize);
$content = addslashes($content);
fclose($fp);
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
}

include 'library/config.php';
include 'library/opendb.php';
$query = INSERT INTO upload (name, type, size, content ) .
 VALUES ('$fileName', '$fileType','$fileSize', 
'$content');
mysql_query($query) or die('Error, query failed');
include 'library/closedb.php';
echo brFile $fileName uploadedbr;
}
?
form action= method=post enctype=multipart/form-data name=uploadform
  table width=350 border=0 cellpadding=1 cellspacing=1 class=box
tr
  td width=246input type=hidden name=MAX_FILE_SIZE 
value=200input name=userfile type=file class=box id=userfile
 /td
  td width=80input name=upload type=submit class=box id=upload 
value=  Upload  /td
/tr
  /table
/form
/body
/html
 
56Kb , 75 Kb files are accept to store , but more that 1 MB we cant upload. It 
wont give any error messages . But that particular data wont displayed.
 
so , this is a big problem for me . i couldnt sorted out yet . I used mysqlcc 
and sqlYOG as well to upload images ( contents ).
 
in like this situations how can we work with mp3 and such huge files 
 
please .  help me very very urgent 
 
Thanx in advance,
Kane. 


-
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Re: upload images / mp3 more Than 1 MB capacity ---- please help

2005-10-13 Thread Jigal van Hemert

Kane Wilson wrote:
But when i try to store little but huge gif files it wont store . 


First of all, use the method described at 
http://www.php.net/manual/en/features.file-upload.php for a safe way to 
handle file uploads. It could be that you run into a server limit which 
will show up if you use that method.


I do think that you exceeded the max_allowed_packet size for MySQL 
queries which has a default value of 1048576 (=1MB). You can increase 
this number (must be done in both client and server!!), but it is 
usually best to store huge files in a file system and not in a database.


Kind regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: upload images / mp3 more Than 1 MB capacity ---- please help

2005-10-13 Thread Kane Wilson
thanx for the reply , usually , i uploading jpg and gif files into mysql 
database , there is no any issue. we can display them correctly.
when i try to upload such huge mp3 files and some .jar files into the databse , 
i  used mysqlcc GUI and SQLYOG GUI , from those interfaces also giving 
troubles. contents wont stored.
my requrement is any how keep the contents , in the mysql database, i have high 
performance machine. so then i'm not worry about perforamnce.

please , let me know how could be the way to store such files in a mysql 
databse ??? 
 
please help 
 

Jigal van Hemert [EMAIL PROTECTED] wrote:
Kane Wilson wrote:
 But when i try to store little but huge gif files it wont store . 

First of all, use the method described at 
http://www.php.net/manual/en/features.file-upload.php for a safe way to 
handle file uploads. It could be that you run into a server limit which 
will show up if you use that method.

I do think that you exceeded the max_allowed_packet size for MySQL 
queries which has a default value of 1048576 (=1MB). You can increase 
this number (must be done in both client and server!!), but it is 
usually best to store huge files in a file system and not in a database.

Kind regards, Jigal.


-
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Re: upload images / mp3 more Than 1 MB capacity ---- please help

2005-10-13 Thread SGreen
AS JIGAL SAID : 
make sure you are not creating an INSERT statement bigger than the 
max_allowed_packet setting for both your destination server and your 
client library (whichever ones you are using). If you attempt to create a 
packet that is too large, the server will _ignore_ it. Because the packet 
(SQL statement)  is too large, it is considered malformed and any 
processing of it will be aborted. 

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

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine



Kane Wilson [EMAIL PROTECTED] wrote on 10/13/2005 09:25:24 AM:

 thanx for the reply , usually , i uploading jpg and gif files into 
 mysql database , there is no any issue. we can display them correctly.
 when i try to upload such huge mp3 files and some .jar files into 
 the databse , i  used mysqlcc GUI and SQLYOG GUI , from those 
 interfaces also giving troubles. contents wont stored.
 my requrement is any how keep the contents , in the mysql database, 
 i have high performance machine. so then i'm not worry about 
perforamnce.
 
 please , let me know how could be the way to store such files in a 
 mysql databse ??? 
 
 please help 
 
 
 Jigal van Hemert [EMAIL PROTECTED] wrote:
 Kane Wilson wrote:
  But when i try to store little but huge gif files it wont store . 
 
 First of all, use the method described at 
 http://www.php.net/manual/en/features.file-upload.php for a safe way to 
 handle file uploads. It could be that you run into a server limit which 
 will show up if you use that method.
 
 I do think that you exceeded the max_allowed_packet size for MySQL 
 queries which has a default value of 1048576 (=1MB). You can increase 
 this number (must be done in both client and server!!), but it is 
 usually best to store huge files in a file system and not in a database.
 
 Kind regards, Jigal.
 
 
 -
  Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Re: upload images / mp3 more Than 1 MB capacity ---- please help

2005-10-13 Thread Dan Buettner
I tend to disagree - at my place of employment, a newspaper, we have 
hundreds of gigabytes of BLOB data (ad and page layouts  digital 
artwork) stored in SQL databases.  Granted we are using Sybase for 
that and not MySQL but there are a lot of advantages to it - access 
control, change control and tracking, easy insertion and deletion, 
and access from any client right through the database driver so you 
can repurpose content more easily.


I have stored smaller amounts of BLOB data in MySQL for side projects 
in the past, without trouble.


Do understand though that storing BLOB data in the db will impact 
your table optimization and repair times as well as backup/recover 
times.


You might also want to plan ahead and devise a scheme to spread the 
data among several tables, to allow optimization of just one table a 
day (for example) and even to allow you to split storage across 
multiple devices should your database get too large.


Dan


At 3:09 PM +0200 10/13/05, Jigal van Hemert wrote:

Kane Wilson wrote:

But when i try to store little but huge gif files it wont store .


First of all, use the method described at 
http://www.php.net/manual/en/features.file-upload.php for a safe way 
to handle file uploads. It could be that you run into a server limit 
which will show up if you use that method.


I do think that you exceeded the max_allowed_packet size for MySQL 
queries which has a default value of 1048576 (=1MB). You can 
increase this number (must be done in both client and server!!), but 
it is usually best to store huge files in a file system and not in a 
database.


Kind regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]