WHFSFolder::CreateFile (open)

Create a new file

Syntax

LOADLIB "mod::system/lib/internal/whfs/objects.whlib";

OBJECT FUNCTION CreateFile(RECORD metadata, RECORD options)

Parameters

RECORD metadata

Metadata of the new file. All cells except name are optional

BLOB data

Data of the file

STRING description

Description of the file (max 2048 bytes)

STRING externallink

URL this file links to

INTEGER filelink

Id of object this file links to

INTEGER id

Id of the new file

STRING keywords

Keywords (string, max 1024 bytes, optional)

DATETIME modificationdate

Modificationdate for this file

STRING name

Name of this file (required, must check ok with IsValidWHFSName)

INTEGER ordering

Relative ordering vs other objects in the parent folder

BOOLEAN publish

Whether this file is published. Ignored for non-publishable file types

STRING title

Title of the file (max 256 bytes)

INTEGER type

Id of the type of this file

RECORD options

Options

BOOLEAN setindex

Set to TRUE to make this document the folder's index

Return value

OBJECT
Possible objecttypes:

New file object