UploadTask in a Workflow
Is there an example of uploading files to a Geoprocessing service in a Workflow?
0
-
Hi Hen,
Does this help at all?
C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\Default\REST Elements\Sample Sites\Workflow_Samples\Resources\Workflows\ArcGIS Server\Geoprocessor.xaml
Regards,
Wayne Richard
Latitude Geographics Group Ltd.
Head Office: 300 – 1117 Wharf Street Victoria, BC Canada V8W 1T7
Tel: (250) 381-8130 | Fax: (250) 381-8132 | wrichard@latitudegeo.com
Developers of Geocortex web-based mapping software | www.geocortex.com
An Esri Platinum Business Partner0 -
Hi Wayne,
Ended up crafting a multiform http query:string contentType = "application/zip"; string url = "https://ourdomain.com/arcgis/rest/services/Tools/gp_service_1/GPServer/uploads/upload?token=" + servicetoken; WebClient webClient = new WebClient(); string boundary = "------------------------" + DateTime.Now.Ticks.ToString("x"); webClient.Headers.Add("Content-Type", "multipart/form-data; boundary=" + boundary); string fileData = webClient.Encoding.GetString(filetopost); string package = string.Format("--{0}\r\nContent-Disposition: form-data; name=\"file\"; filename=\"{1}\"\r\nContent-Type: {2}\r\n\r\n{3}\r\n\r\n--{0}\r\nContent-Disposition: form-data; name=\"f\";\r\n\r\n{4}\r\n--{0}--\r\n", boundary, filename, contentType, fileData, "json", uploaddescription); byte[] nfile = webClient.Encoding.GetBytes(package); results = webClient.UploadData(url, "POST", nfile);
thanks
Hen0 -
Hi Hen,
Thanks for sharing your solution.
Regards,
Wayne0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare