> > blobs (aka attachments) are more self-contained and can be attached to
any
> > record type. Methods are available to serve out blobs including their
> > headers, and blobs attached to page records are served directly by
> > mod_midgard (depending on needed authorization of course).
>
> What does it mean when you say 'served directly'?
>
> David's sample code for blobifying was a good guide
> http://marc.theaimsgroup.com/?l=midgard-dev&m=95684800219327&w=2 ),
though
> a few additional examples would be great too.
Here is a code that serve directly blob images (you'll need to be owner of
the page though, admin will do it). Put it in a page and it does (should)
work !
<?
$a=mgd_get_page($midgard->page);
if($delete)
{
$a->deleteAttachment($delete);
}
if($blobify && $userfile)
{
$a->createAttachment($userfile_name,$title,$userfile_type);
$fa=$a->openAttachment($userfile_name);
$fu=fopen($userfile,"r");
while(fwrite($fa,fread($fu,$userfile_size))==$userfile_size);
fclose($fu);
fclose($fa);
?>User file &(userfile_name); blobified !<br>
<?
}
?>
<FORM ENCTYPE="multipart/form-data" ACTION="&(midgard.uri);" METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000">
Blobify this file: <INPUT NAME="userfile" TYPE="file"><br>
Entitle this file: <INPUT NAME="title" TYPE="text"><br>
<INPUT TYPE="submit" NAME="blobify" VALUE="Blobify File">
</FORM>
<?
$lb=$a->listAttachments();
while($lb && $lb->fetch())
{
?><img src="&(lb.name);"><br><a href="?delete=&(lb.name);">del
&(lb.title);</a> &(lb.mimetype);<br><br>
<?
}
?>
David
--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org
To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]