I was also trying to upload a file, however a serverobjectextension-file (SOE) and with c#. I finally found a solution: - I had to add ContentType "application/x-zip-compressed" to the header of the file content. - The file-Parameter had to be named "itemFile" instead of "file" !!!!! The relevant code part: using (FileStream stream = new FileStream(soePath, FileMode.Open)) using (HttpClient client = new HttpClient()) { MultipartFormDataContent content = new MultipartFormDataContent(); content.Add(new StringContent("pjson"), "f"); content.Add(new StringContent(token), "token"); content.Add(new StreamContent(stream) { Headers = { ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/x-zip-compressed") } } , "itemFile", soePath); Task<HttpResponseMessage> task = client.PostAsync($"{Service}/admin/uploads/upload", content); Hope that helps.
... View more