mgd_open_attachment

Name

mgd_open_attachment -- Open a filehandle to an attachment

Synopsis

filehandle mgd_open_attachment(int id, string [mode]);

Description

Minimum version: Midgard 1.4 (Bifrost)

Opens a filehandle to the attachment with id id.

mode may be any of the following:

The optional parameter mode will default to "w" if omitted. Returned value is a file pointer which can be used with the usual PHP file functions. Use fclose() on the filehandle when done.

Returns a filehandle if successfull. Returns false on failure.

Example

<?php
  $filehandle = mgd_open_attachment(13,"w");
  fputs($filehandle, "Writing to an attachment right now...");
  fclose($filehandle);
?>