[thelist] media/image management

Chris W. Parker cparker at swatgear.com
Mon Jun 30 13:52:20 CDT 2003


Anthony Johnston . Antix Software Limited <> wrote:

> > I'm looking for db schemas for storing rich media files.
> 
> me too,  this is the conclusion I came to
> 1)	tables for each logical item,
> 	i.e. one for documents,  one for images etc...
> 2)	one table for the binary data

As an alternative, here's what I was planning to do.

One table stores all the media with a column that designates the type of each file. The file data itself is stored on the server and not in the database.

media
-----
id
prodid
title
url
type
dateadded

id:

this is just an auto incrementing number

prodid:

this stores the id of the product that each media resource is related to.

title:

this is just a descriptive title of needed, maybe something like "Here's a short clip of Jerry using the new ProductA".

url:

url will be dynamically assigned by the server. uploading and placement of files will be decided by the server.

the way i have it planned is that when a site author uploads a file they have a few form fields to fill out.

first they have to find the file they want to upload to the server on their local pc, then they have decide what file type it is and either (haven't decided yet) choose a product from a drop down list or type in the product id manually. a third option, and what will normally be the case, is that the person will click "add media" on a products adminstrative page and they won't have to fill out the product id at all.

then they submit it. the server will, based on the product type, send it to one of a few different directories. i.e. media/images/, media/video/, media/audio/. from there, it will be given a new filename. (i haven't decided if this is the best thing to do yet, but it seems like a good idea right now.)

type:

The type will probably be defined in a separate table so that it can be administered via a web page. The different types I've come up with so far are:

0 = thumbnail
1 = small graphic
2 = medium graphic
3 = large graphic
4 = video (likely just mpg/avi)
5 = 360 degree rotation animation
6 = sound (mp3)

This list may or may not change later.

dateadded:

This is data is automatically added each time a new record is inserted.



This is email turned out to be much longer than I had planned, but hopefully it had some good information in it.

I'd also appreciate feedback on what I've said in case someone already see's a flaw(s) in this design.



Thanks,
Chris.


More information about the thelist mailing list