GetFileField

Gets one or more files from a File field on a specified item.

Parameters

Name Type Description
GetFileField Function

Returns File field contents on a primary or auxiliary item.

table
  • ID (integer)
  • UUID (string)
  • dbname (string)
  • name (string)

The primary or auxiliary table identifier.

item
  • ID (integer)
  • UUID (string)

The item identifier.

field
  • ID (integer)
  • UUID (string)
  • dbname (string)
  • name (string)

The File field identifier.

Post Data

You can optionally use the GetItem function in an HTTP POST and include one or more of the following objects:

Name Type Description
includeFile

(optional)

boolean

Use includeFile to return the base64-encoded contents of the file. Default is true.

Note: If one or more files are included in the response, the cumulative total of all files that are returned is limited to 50 MB in size. If the total size of the included files is greater than 50 MB in size, you will only receive the meta data about the file attachments in the response. To change the size limit for all files in the response, see solution S142607.
fileObjFilter

(optional)

Array of identifiers
  • ID (integer or string)
  • UUID (string)
  • FILENAME (string)
  • NAME (string)

Include fileObjFilter to filter the File field entries that are returned. Otherwise, all files are returned by default.

Note that you can pass any type of identifier in the array, or a combination of them in order to return the desired files.

Example

URL:

http://AEserverName/GetFileField/1000/141/FILEFIELD

Post data:

{"includeFile":true, "fileObjFilter": [ "myFileOne.txt", 3 ]}

Response:

{
 "fieldFileObj": {
  "id": 189,
  "uuid": "0efe57ae-eda4-4f46-b3af-3370a7097545",
  "name": "FileField",
  "dbname": "FILEFIELD",
  "fldtype": 132,
  "fldtypelabel": "file",
  "fileObjList": [{
    "id": 1,
    "uuid": "31e7a4fb-f688-4482-8780-be3a013039ce",
    "name": "notes about issue",
    "filename": "myFileOne.txt",
    "filesize": 16,
    "fileurl": "http://AEserverName...FileObjectPage&FileObjId=1/myFileOne.txt",
    "contentsBase64": {
     "data": "dGhpcyBpcyBmaWxlIG9uZQ=="
	}
   },
   {
	"id": 3,
    "uuid": "379c4c0d-34b4-4554-be37-316c6f368369",
    "name": "additional notes",
    "filename": "myFileTwo.txt",
    "filesize": 16,
    "fileurl": "http://AEserverName...FileObjectPage&FileObjId=3/myFileTwo.txt",
    "contentsBase64": {
     "data": "dGhpcyBpcyBmaWxlIHR3bw=="
    }
   }
  ],
  "fileObjCount": 2
 },
 "result": {
  "type": "OK",
  "msg": ""
 }
}

Comments

Because the TS_ID is subject to change in a promotion context, you may need to update the table and item parameters with the TS_ID from the target environment after the promote is finished.