| ATTACH_FILE | ATTACH Endpoint | |
| /rpc/attach/?method=ATTACH_FILE | ||
|
This method allows you to upload files. The file needs to be sent via a form POST with enctype="multipart/form-data". The maximum combined size of attachments is 10mb. Note: You cannot submit structure elements with the post. Instead use CORE_ATTACHMENT_MANAGE to do so. To attach to a folder created using SETUP_SITE_ATTACHMENT_FOLDER_MANAGE, set &object=417 & &objectcontext=[folder ID]. |
| PARAMETERS | TYPE | ||
| Bucket | Numeric | An Amazon S3 bucket as configured via SETUP_AWS_S3_BUCKET_MANAGE. It applies to all files in the upload | |
| BucketFileNameN | Text (1000) |
'N' start at 0 for the first file. The name of the file in the bucket. Can have '/' to make a path. Defaults to [object title]/[object id]/[guid_filename]. |
|
| DescriptionN | Text (2000) | ||
| FileN | Object / File | ||
| FileNameN | Text | Filename that is used when downloading the file. Defaults to the name of the file | |
| IdN | Numeric | Id of attachment to replace (Attachment Id) | |
| Object | Numeric | ||
| ObjectContext | Numeric | ||
| PublicTypeN | Numeric | 1=As Per Normal Object Rules [default],2=Public,3=Not Public. To be able to have public attachments, you need profile setting 460 set to Y | |
| SourceTypeN | Numeric | 1=File [default], 2=URL | |
| TitleN | Text (250) | ||
| StatusN | Numeric | You define these yourself via SETUP_ATTACHMENT_STATUS_MANAGE | |
| TypeN | Numeric | You define these yourself via SETUP_ATTACHMENT_TYPE_MANAGE | |
| URLN | Text (200) | Must be blank if SourceType = 1 (File). Cannot be blank if SourceType = 2 (URL) |
| RETURN | ||
{"status": "OK","notes": "RETURNED","instance": "lab-001","xhtmlcontext": "","data": { "rows":
[
{
"filename": "1.jpg",
"attachment": "17081",
"attachmentlink": "17174"
}
]
}
,"startrow": "0","rows": "20","morerows": "false","moreid": "192555"}
|
| EXAMPLES |