Open Source Content Management System

$object->openattachment

  1. Description

$object->openattachment -- Open a record attachment as a file handle

Description

`filehandle **$object->openattachment** (string name, string _ mode_)`

Minimum version: Midgard 1.4 (Bifrost)

Opens the attachment for writing. This will delete existing content unless you use the second (optional) parameter to specify the open mode; see the mode parameters for fopen(), the default is "w". The return value is a file pointer which can be used with the usual PHP file functions. Use fclose() on the filehandle when you are done.

Returns a filehandle if successful. Returns FALSE on failure.

openattachment("curriculum"); // and the attachment too.  
      fputs($fh, "My curriculum");  
      fclose($fh);  
    ?>

Method available for: article, element, event, event_member, group, host, member, page, pageelement, pagelink, person, preference, sitegroup, snippet, snippetdir, style and topic objects.

Designed by Nemein, hosted by Anykey