REST - Attach
The EWAttach REST operation:
- Attaches the file passed in the body of the request to the specified field of the record identified by the supplied primary key.
- Accepts the URL with parameters as per general URL conventions which can be viewed in the REST Interface Overview. Additionally, the URL must contain the identifier of the record, the name of the field to attach the file to and the file name to use. The file content is passed in the body of the request.
- Supported Content-Type: multipart/form-data
- Returns the current number of files attached to the specified field.
- All parameters must be properly URL-encoded.
- At present browsers do not support sending PUT requests. This REST operation is intended for the use of application clients. If you need to attach a file from a browser, use the regular POST requests with EWCreate or EWUpdate operations, and specify enctype="multipart/form-data" in the browser HTML form.
Assume an instance of Agiloft is available on localhost, port 8080 and is called "Demo". Attach a file to the field "someField" in record 1234 of table "someTable" with a file name as testfile.zip.
The request has to be issued via the PUT HTTP method where the body contains the content of the file to be attached.
The following result will be returned when the file is attached: