CPosting::SaveFile( int ID, array file );
The method SaveFile adds an attachment to an issue. The attachment is stored and registered in the file table (b_file).
Parameter | Description |
---|---|
ID | The issue ID. |
file | Array of file data in the format:Array( "name" => "file name", "size" => "size", "tmp_name" => "temporary path on the server", "type" => "file type");You can obtain this array directly from $_FILES[field_name] . |
Retuns the ID of the registered file on success, or false otherwise.
if (strlen($save)>0 && $REQUEST_METHOD=="POST") { $file_id = CPosting::SaveFile($ID, $_FILES["FILE_TO_ATTACH"]); if ($file_id===false) strError .= "Error storing the attachement."."<br>"; }
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |