Open Source Content Management System

File Attachments in Midgard

  1. Attachment management API
  2. The blob directory

Attachments, also known as blobs, can be used to administer and serve out arbitrary data with Midgard. This will typically be used for images, sounds, flash movies, etc. and for files available for download.

Attachments can be connected to any kind of resource, and Attachments to Page records will be served out directly based on their name.

Entity-Relationship Diagram for Attachment

Blobs are served from the filesystem rather than stored in the database, as this is more efficient.

Attachment management API

See the Attachment API article for more information.

The blob directory

To prepare your setup for blob serving, create a directory to store the attached file, e.g. /home/httpd/blobs, and make sure the user that apache runs as (e.g. nobody) has read permission for this directory. Write permission is not necesary.

Within this directory, create the directories that the actual files will be stored in by executing:

mkdir `perl -e '@dirs = split(//, "0123456789ABCDEF"); 
  foreach $l1 (@dirs) { print "$l1\n"; 
  foreach $l2 (@dirs) { print "$l1/$l2\n"; } }'`
chown -R nobody *
chmod -R u+rwx *

In your httpd.conf, specify the blob directory:

MidgardBlobDir /home/httpd/blobs

This is done automatically to you by Datagard when setting up new Midgard databases

Designed by Nemein, hosted by Anykey