Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BigBlobs

Status
Not open for further replies.

ThomasJSmart

Programmer
Sep 16, 2002
634
Having a problem with blobs here, not sure if its a php limit or a server limit though.

i have a function that turns any video into an FLV file and generates a thumb. both files are stored in a tmp directory. then converted to a variable like this:
Code:
$fp= fopen($fd, 'r');
$thumb = fread($fp, filesize($fd));
$thumb = addslashes($thumb);
fclose($fp);
(Same code for the video file)

and then they are inserted into a DB with some other variables.

now the upload and convert and thumb generation all works fine.

inserting into a DB is giving a problem though if the files are bigger.

a 200kb avi works fine, a 1.3mb avi or bigger isnt working at all.... (as i said upload and conversion is working fine, just the inserting into DB isnt).

is there a max size a php variable can have?
is there another way to insert such big blobs?
or should this just work....?

Thank you






I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
can you try this code instead (assuming mysql)
Code:
$thumb = mysql_escape_string(file_get_contents($fd));
 
sleipnir, the server in question is a server setup only for this one website that will be using the functionality, so it should have enough resources. and its much easier to admin the files if they are all together with the info in a databse... also its a bit of an experiment to see how it works, i havnt realy found any conclusive info on which way is better :-/

jpadie, im afraid it didnt do the trick,

i guess i'll just store them in a folder instead, i need to get this site finished ^^





I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 

$fd='tmp/'.$tempcode.'.jpg';
(tempcode is just a uniq code for the image)



I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
i'd guess that all we're left with is an examination of the upload script that you're using. often people think that uploads work fine when in fact they don't but the reporting is not too clear.
 
the upload realy does work though :)
currently i have disabled the "store as blob" bit, so the files are just being upped to a folder, and they are working fine, i can play them in my videoplayer online..


I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
the server in question is a server setup only for this one website that will be using the functionality, so it should have enough resources. and its much easier to admin the files if they are all together with the info in a databse... also its a bit of an experiment to see how it works, i havnt realy found any conclusive info on which way is better
If management is your primary concern, store the files on the server's filesystem and the filename in the database. You can manage these files just as easily and can probably serve them more efficiently.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top