[prev in list] [next in list] [prev in thread] [next in thread]
List: midgard-user
Subject: Re: [midgard] blobs, files and images
From: Emiliano <emile () iris-advies ! com>
Date: 2000-05-29 17:56:25
[Download RAW message or body]
On Mon, 29 May 2000, [ IGP Internet ] wrote:
> > 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'?
Blobs attached to page records can be handled by mod_midgard alone,
without midgard-php coming into play. So if you have page /some/sample
with an attached blob by the name of image.gif, a request for
/some/sample/image.gif would be handled without needing PHP coding. The
page it was attached to wouldn't even see the request, whether it's active
or not.
> Anyway, these are things I was thinking about:
> - letting user download a blob. This should be easy, serveattachment should
> do it, right?
Yes, or it can be (is) handled by mod_midgard autonomously for page
attachments.
> - display blob in html page, say image.gif is stored as attachment. Same as
> above, figured it out now...
> html page says ie.:
> <img src="/?displayimage=&(some_blob.id);">
> and code-global says (doesn't have to be code-global, can be separate page
> or whatever):
> if ($displayimage) {
> mgd_serve_attachment($displayimage);
> exit;
> }
mgd_server_attachment takes an id, not a name, but yes, correct.
> When on this, what about getattachment in addition to listattachments so we
> don't have to walk though all of them if we know what to search for?
getattachment is available, mgd_get_attchment(id) or
$object->getattachment(name).
> Another thing, methods $object-><methodname> are not equal to functions
> mgd_<methodname>. Underscore has to be put between words, ie.
> mgd_serve_attachment(int id); and not mgd_serveattachment(int id);
That is correct. It was the method vs function naming I found when I
started blobserving so I followed suit.
> And, is there a way to get a hold of location field of a blob? Say I wanted
> to pass that to perl which would read the blob from the disk, parse it, and
> send the result back...
There isn't, by design. I intended the blobs to be handled by their
functions/methods only for reasons of security, since the blobs may well
contain information you don't want to share with just anyone. Yes yes, I
know, SbO. Setting up a well thought out PHP secure mode should supplement
this of course.
Then again, if this is too paranoid for peoples' taste, it's easily
changed.
Emile
--
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
midgard-unsubscribe@greywolves.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic