How to Upload file using Send Web Request Activity?
Looks like the Send Web Request can't handle multipart/form-data very well or i'm doing something wrong.
I'm trying to upload a file to a Geoprocessing service via the upload method using the send web request activity because it supports the POST method.
http://<service-uploads-url>/upload
(POST only)
Has anyone been successful at this?
Here are the parameters i'm using:
URL: https://mydomain.com/gp01/rest/services/Test/KMLProcessAsync/GPServer/uploads/upload?f=json
Method: POST
Headers: ={"Content-Type":"multipart/form-data"}
FORM: ={"f":"json", "file":$frmImportKMLKMZ.state.filePickImportKMLKMZ.value.files}
-
I'm having this same problem when using the form and files. If I just use normal key/pair strings it is fine but once the files come into it then it doesn't work as I would expect. (as in I've tested with Postman and the web request works)
Has anyone else had success with this?
My form looks slightly different to yours Carlos -->
FORM: ={
"MidFile":$chooseFilesForm.state.mid_fp.value.files[0],
"MifFile":$chooseFilesForm.state.mif_fp.value.files[0],
"ObjectId":$objectId.result
}
0 -
I ended up creating a custom activity for it. I threw it up on github in case it helps:
https://github.com/capdragon/GIS/blob/master/Geocortex/Worflow5/CustomActivities/GPFileUpload.ts
0 -
I have been struggled for whole night but couldn't work out the answer...Need upload a file to GPservice via workflow, and easy thing in WF4 but seems so hard now now in WF5.
I've tried upload file to our ArcGIS Server via Postman it works, and I tried to mimic the request code from Postman in the Send Web Request activity but it didn't work. It's just unclear how to attach the actually content of the file (in my case a csv file) to the request, or does the activity actually support file upload. Could @Geocortex Support? provide a working example showing how to upload file using Send Web Request to the ESRI sample site http://sampleserver6.arcgisonline.com/arcgis/rest/services/GDBVersions/GPServer/uploads/upload
@Carlos Krefft? , thanks for sharing the custom activity. I have never deployed a custom activity before, could you please point some direction how to deploy it? does it requires on-premise or works on SaaS-version WF5 too.
0 -
Does anyone have a solution?
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare