IntroductionIn this blog we will show you how to use the FME Since this operation uploads a file, it must send a multipart request pursuant to IETF RFC1867. In this example we will upload PDF files, but this protocol does support other MIME types as well. Preparation
|
![]() |
|
In this sample URL, the addAttachment
operation is performed on the feature with the OBJECTID @Value(OBJECTID)
belonging to layer 0 of the Points feature service:
https://services.myserver.com/arcgis/rest/services/Points/FeatureServer/0/@Value(OBJECTID)/addAttachment
After you have taken the preparatory steps above, you should be able to configure the HTTPCaller with the following parameters (click on the images for detailed information):
Request URL | A valid URL pointing to your layer plus /@Value(OBJECTID)/addAttachment |
|||
HTTP Method | POST | |||
Query String Parameters | ||||
Name | Value | |||
---|---|---|---|---|
token | token (Attribute Value) | |||
f | json | |||
Upload Data | Multipart / Form Data | |||
Multipart Upload | ||||
Name | Type | Value | ||
name | String Upload | attachemnet | ||
filename | String Upload | path_filename (Attribute Value) | ||
fileobj | File Upload | path_windows (Attribute Value) | ||
content_type | String Upload | application/pdf |
![]() |
JSON response exampleYour FME workspace will most probably not have a Writer (if adding the attachments was the final purpose of your script). But you can always connect an Inspector to view the results in FME Data Inspector. The content of the column {
"addAttachmentResult" : {
"objectId" : 31,
"globalId" : "1e4c5679-b952-4f40-9eec-6134131f84a0",
"success" : true
}
}
Happy coding! |
|
Egge-Jan Pollé