# upload_attach

# Important Notice

upload_attach 方法出现在实现当中,但是以该方法命名的 API 并没有出现在 References 中,而是作为 upload.php 接口的子方法。

该方法的实际功能和接口参数需要进一步测试。

# Function

Function Name Description Level
upload.php This function allows the app to pass the actual file content to the forum system. It allows user either to upload attachments to a post ("method_name=upload_attach"), or to update his own profile picture ("method_name=upload_avatar"). For profile picture upload, it is used in conjunction with "can_upload_avatar" in "login" function to indicate users has the permission to change his own profile picture.

Input Parameters:

Name Type Required? Description Level
method_name byte[] yes For attachmet upload, set this as "upload_attach". For avatar upload (profile picture upload), set this as "upload_avatar".
forum_id String For "method_name=upload_attach" only. Forum ID, needed when upload attachment to post
message_id String For "method_name=upload_attach" only. Conversation/PM ID, needed when upload attachment to Conversation/PM
group_id String For "method_name=upload_attach" only. This ID is used to group attachments and associate them to a single post. Useful for multiple attachments upload support. The group_id can be obtained from the result of this function. The app can pass NULL value to this field if it is the first attachment for the post.
type String Post type, where the attachment was uploaded to. Current valid value is 'post' or 'pm'. Default is 'post. When this parameter was set to 'pm', no need forum_id parameter then.
content byte[] yes This is the multi-part upload file name.

Output Parameters:

Name Type Required? Description Level
result Boolean yes Return "true" if the action is executed successfully. "false" otherwise.
result_text byte[] Message to be displayed to user after this action is executed. Optional.
attachment_id String yes This ID is needed by the app to pass into the new_topic or reply_post functions to finalize the attachments linkage with the post.
group_id String This ID is needed by the forum system to associate attachments with a specific post. Do not return this field if a forum system does not require group_id for attachment assication. This group_id can also be dynamic depends on the forum system.
filters_size Int Return the file size of the uploaded file after processed by the forum system.