Jukka Zitting wrote:

> The only problem with this is that then normal MySQL client API doesn't
> support streaming the BLOB contents. In fact the communication buffers
> used by MySQL are limited in size so although they the size is
> configurable, you could run into troubles with large files. I'm not sure
> if or how MyODBC handles this.

The fact mysql has no streaming (while most of our users use it) would
make that not an option for me, at least not now. Unless there's
another way to get at large BLOBs in MySQL that doesn't require lots
of RAM.

Having the BLOB size limited by the database is fine by me, as long
as it can be changed without recompilation.

If MySQL has no efficient alternative I could use as a fallback
mechanism
we could settle on having page BLOBs served from the FS directly for
the moment.

Let's say we have
$attachment = mgd_create_attachment($table, $parent, ...);
  (or $article->create_attachment(...); ?)
mgd_replace_attachment($attachment, ...);
mgd_delete_attachment($attachment);
$attachment = mgd_get_attachment($table, $parent);

$cursor = mgd_list_attachments($table, $id);
$attachment = $cursor->fetch();
which would retrieve the following properties

  $attachment->tbl, $attachment->parent, $attachment->alt,
$attachment->type,
  $attachment->name, $attachment->size and $attachment->md5

and have $attachment->content() retrieve the contents of the file
and $attachment->serve() stream the content to the client (like readfile
does).

This should migrate pretty easily to a situation where we could serve
the BLOBs from the database in a generic streaming fashion, and would
not require access to or knowledge of the physical location of the
attachment files.

Will the 2.0 API change affect this kind of scenario? Anyone have better
ideas for BLOB handling? Is BLOB serving even usefull to anyone but me?

Bye,
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
[EMAIL PROTECTED]

Reply via email to