Chapter 24. Attachments

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, not just articles as with the Midgard file functions, and attachments to page records will be served out directly based on their name.

To prepare your setup for blobserving, 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