Open Source Content Management System

$object->createattachment

  1. Description

$object->createattachment -- Create a record attachment

Description

`int **$object->createattachment** (string name, string title, string mimetype)`

Minimum version: Midgard 1.4 (Bifrost)

Is used to create a new, empty attachment to the record represented by the object.

Returns attachment id if successful. Returns FALSE on failure.

createattachment("test","example","text/html");  
      if(! $att) {  
        echo "Failed to create attachment.
\n"; echo "Reason: " . mgd_errstr(); } else { echo "Attachment created. ID is $att.
\n"; } ?>

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