xoops forums

grandfso

Just popping in
Posted on: 2004/8/13 9:06
grandfso
grandfso (Show more)
Just popping in
Posts: 14
Since: 2004/8/8 1
#1

Storing imgs, in database insead of uploading 'em

Hello, i want to store imgs in database as a binary data, instead of uploading them to the server. i dont know how may i change it.
I am using my-album v.2.83
hope, someonell give me an advice

tedsmith

Home away from home
Posted on: 2004/8/13 14:18
tedsmith
tedsmith (Show more)
Home away from home
Posts: 1151
Since: 2004/6/2 1
#2

Re: Storing imgs, in database insead of uploading 'em

Log in as Administrator, go to System, then select Images.

At bottom, there is a selection utility to define whether to upload or store as BLOB (Binary Large Object) in Database.

Hope this helps.

djsckizo

Just can't stay away
Posted on: 2004/8/13 15:41
djsckizo
djsckizo (Show more)
Just can't stay away
Posts: 401
Since: 2003/5/9 8
#3

Re: Storing imgs, in database insead of uploading 'em

is doing this a good or bad thing though? won't it be more intensive on the database?

grandfso

Just popping in
Posted on: 2004/8/13 16:01
grandfso
grandfso (Show more)
Just popping in
Posts: 14
Since: 2004/8/8 1
#4

Re: Storing imgs, in database insead of uploading 'em

Quote:
Log in as Administrator, go to System, then select Images.

At bottom, there is a selection utility to define whether to upload or store as BLOB (Binary Large Object) in Database.

Hope this helps.


i am not sure if itll take effect on my-album, what do you think?

tedsmith

Home away from home
Posted on: 2004/8/13 17:05
tedsmith
tedsmith (Show more)
Home away from home
Posts: 1151
Since: 2004/6/2 1
#5

Re: Storing imgs, in database insead of uploading 'em

Well, I'm no expert.

I use myAlbum, and have got it set to simply upload because I don't really like the idea of storing the pics in the database - not for any particular reason - I just think it sounds 'risky'.

In my case, I know that I can delete records and any pictures that go with them direct from XOOPS Admin, so it isn't like i need to have them seperated - I won't be manually sifting through the uploads folder so they can just sit there for all I care - as long as the database and XOOPS knows which one's go with which record, that's OK. Do you see my point?

I don't know what the advantages or disadvantages are I'm afraid.

I think it will effect myalbum because it creates a folder called 'photos' in your uploads folder. If XOOPS has been told to store images in the database, then I expect that will talk to the myalbum module and tell it to do the same.

Sorry I can't help more - I am sure an expert will be able to help if they read this.

djsckizo

Just can't stay away
Posted on: 2004/8/13 17:59
djsckizo
djsckizo (Show more)
Just can't stay away
Posts: 401
Since: 2003/5/9 8
#6

Re: Storing imgs, in database insead of uploading 'em

Quote:

tedsmith wrote:
Log in as Administrator, go to System, then select Images.

At bottom, there is a selection utility to define whether to upload or store as BLOB (Binary Large Object) in Database.

Hope this helps.



I don't think myalbum will be affected by that. I think that only applies to images uploaded through that specific XOOPS admin utility.

grandfso

Just popping in
Posted on: 2004/8/13 19:45
grandfso
grandfso (Show more)
Just popping in
Posts: 14
Since: 2004/8/8 1
#7

Re: Storing imgs, in database insead of uploading 'em

Well, i want upload images to database, because on my server i've got 100mgs of webspace, and non-linited database size. I am going to make my own PC Game vortal, and i think i'll need many free space for screenshots and stuff like wallpapers for example. I know it may be 'risky', but its good idea as long as db size is unlimited ^_^

tedsmith

Home away from home
Posted on: 2004/8/14 23:26
tedsmith
tedsmith (Show more)
Home away from home
Posts: 1151
Since: 2004/6/2 1
#8

Re: Storing imgs, in database insead of uploading 'em

thats a good point - I am limited to 100MB and expect lots of picture uploads, so if database size not limited then that is perfect.

Perhaps some who really knows could help us all here? Are there any downfalls to putting pics in database - performance, management etc?

Hoosty

Just popping in
Posted on: 2004/8/14 23:52
Hoosty
Hoosty (Show more)
Just popping in
Posts: 14
Since: 2004/5/8 1
#9

Re: Storing imgs, in database insead of uploading 'em

Hi

I have been storing my images in the MySQL database as BLOB since this feature became available with XOOPS. On my system it does not slow anything down and has been running well and with no problems to report.

Advantage is that yes the database grows in size but when one wishes to back up ones site it is done by simply downlaoding the database, pictures and all. A restore is also a breeze. Myalbum has a XOOPS image manager hook which allows the BLOB data to be used within the myalbum module, nice feature GI JOE

Cheers

Hoosty

tedsmith

Home away from home
Posted on: 2004/8/15 14:20
tedsmith
tedsmith (Show more)
Home away from home
Posts: 1151
Since: 2004/6/2 1
#10

Re: Storing imgs, in database insead of uploading 'em

I've done a little research on this now and it seems that there are two distinct advantges and disadvantages.

Advantages : It gets around PHP safemode file
system issues and filesystem rights/restrictions in general makeing the code a bit more portable because you don't have to think twice about the rights management of the server beyond the database. However, with XOOPS this does not apply (I don't think).

It makes backups easier because you don't have to backup a filesystem and database - just the DBase

Disadvantages : It is apparently slower to access binary data from a database rather than the file system so binary/blob data retrieval from a database can be the bottleneck of a site, especially if it has heavy traffic.

MySQl recommend useing the filesystem for what it was meant for - storing files. They mention it here:

http://www.mysql.com/doc/en/Tips.html

I think for now I'm gonna stick with the filesystem, and then if I need to in the future I'll convert to BLOBing

Cheers

Ted