array CFile::MakeFileArray( mixed file, mixed mime_type = false )
The method MakeFileArray creates an array describing a single file. Structure of the array is similar to that of $_FILES[name]
(or $HTTP_POST_FILES[name]
). This array can be used with methods SaveFile, CheckFile, CheckImageFile.
The array returned has the following format:
Array( "name" => "file name", "size" => "size", "tmp_name" => "temporary path on server", "type" => "file type")
Parameter | Description |
---|---|
file |
Can be one of the following values:
|
mime_type | File MIME type (e.g. "image/gif"). Optional. The default value is "false", which means the MIME type is to be determined automatically. |
<? $arFile = CFile::MakeFileArray($_SERVER["DOCUMENT_ROOT"]."/images/screen.gif"); $arFile["MODULE_ID"] = "support"; $arFields = array( "CREATED_MODULE_NAME" => "mail", "MODIFIED_MODULE_NAME" => "mail", "OWNER_SID" => "user@mail.com", "SOURCE_SID" => "email", "MESSAGE_AUTHOR_SID" => "user@mail.com", "MESSAGE_SOURCE_SID" => "email", "TITLE" => "title", "MESSAGE" => "message" "FILES" => array($arFile) ); //$TICKET_ID = 866; $NEW_TICKET_ID = CTicket::Set($arFields, $MESSAGE_ID, $TICKET_ID, "N"); ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |