| 
	
 | 
 Posted by lawrence k on 05/22/06 07:19 
Alan Little wrote: 
> Carved in mystic runes upon the very living rock, the last words of 
> Henrik Hansen of comp.lang.php make plain: 
> 
> > "lawrence k" <lkrubner@geocities.com> writes: 
> > 
> >> Is it right to say that I can just open any file with file(), get it 
> >> as a string, and then store in a MySql database, in, say, a 
> >> MediumText field? I realize that MySql supports binary fields, but my 
> >> current MySql schema does not have any binary fields, and I'm 
> >> wondering if I can store the file without changing my current schema. 
> > 
> > AFAIK you need to use blob fields as your data is binary (or is it, 
> > what kind of files do you want to open?), if you store 
> > it in a normal text field it can be corrupted. But else you are right, 
> > you just take the ourput from the field and put in a file or output to 
> > the browser with a header infront. 
> 
> You could base64_encode() it first. 
 
Thanks much to the both of you. I've MP3s to store. I will encode them 
with base64_encode() and store them in a mediumtext field. We will see 
how this goes.
 
  
Navigation:
[Reply to this message] 
 |