Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM: Storing images and other binary data in mySQL

date posted 27th April 2008 17:30

Yes in short. I've done it on one site - just to see how to do it
really :) I like it, as you can more easily maintain the documents as
and when you delete a record; instead of having to then delete files
too, with added security issues.

However, I only did it once and have stuck with the usual of storing
files in a separate place and doing deletes of files when deleting db
records.

http://highsierracld.co.uk does it - all the photos the client uploads
are stored and displayed from the db.

I did originally notice though, that the browser didn't seem to cache
images unlike with separate files. So navigating back a page required
images to be downloaded again. The site has been there around 4 years
now and I'm pretty sure images are now cached - unless broadband hides
that problem?

Rob Colton wrote:
> Splendid.
>
> Thanks for that I will follow your advice I think.
>
> R
>
>
> On 27/4/08 17:22, "Alex Townsend" [EMAIL REMOVED] wrote:
>
>> Rob Colton wrote:
>>> Hi
>>>
>>> Is it possible to store images and other binary data into fields in MySQL?
>>> Mostly I just want to save images but small video clips and audio might be
>>> nice too. (I guess it makes no odds what the content is)
>>>
>>> Have a lovely rest of weekend
>>>
>>> Rob
>>>
>> Yes, it's certainly possible to do - you need to use BLOBs (Binary Large
>> OBjects) to do it. The MySQL Documentation has more about BLOBs here (
>> http://dev.mysql.com/doc/refman/5.1/en/blob.html )
>>
>> Personally, I'd never recommend storing files inside MySQL though -
>> you're far better off storing the file in a file system, and holding a
>> pointer to it (usually the filename, to make things easier) in the DB.
>> That way is a lot safer, and less prone to corruption (and to filling a
>> DB with BLOBs) than storing the files themselves inside the database.
>>
>> Alex
>> http://www.ozbon.com
>>
>>
>

--
Dominic Raywood
Rubicon Computer Services Limited
W: http://rubiconcsl.com
E: [EMAIL REMOVED]
T: 08456 521 561 (+44 1823 698420)
F: 08456 521 561
M: 07050 204998 (+44 7811 252573)
Skype: RubiconCSL



Messages by Day
April 30th 2008
April 29th 2008
April 28th 2008
April 27th 2008
April 26th 2008
April 25th 2008
April 24th 2008
April 23rd 2008
April 22nd 2008
April 21st 2008
April 20th 2008
April 19th 2008
April 18th 2008
April 17th 2008
April 16th 2008
April 15th 2008
April 14th 2008
April 13th 2008
April 12th 2008
April 11th 2008
April 10th 2008
April 9th 2008
April 8th 2008
April 7th 2008
April 6th 2008
April 5th 2008
April 4th 2008
April 3rd 2008
April 2nd 2008
April 1st 2008


Messages by Month
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000