Skip to main content

UploadTask in a Workflow

Comments

3 comments

  • Permanently deleted user
    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 Partner

     

     
    0
  • Permanently deleted user
    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

     

    Hen
    0
  • Permanently deleted user
    Hi Hen,

     

    Thanks for sharing your solution.

     

    Regards,

     

    Wayne
    0

Please sign in to leave a comment.