Discussion

Ask a Question
Back to All

Attachment Upload With File Name "Präsentationen_Projekt_X"

I am using the RestSharpExample provided on github I have a filename "Präsentationen_Projekt_X" when I try to upload it the filename on target process becomes "=?utf-8?B?UHL....." here is also the sample chunk of code

                var client = new RestClient(uri);
                await file.CopyToAsync(memoryStream);
                var restRequest = new RestRequest(requestUri, Method.Post);
                restRequest.AddHeader("Content-Type", "multipart/form-data;charset=utf-8");
               

                string encodedFileName = Uri.EscapeDataString(file.FileName);


                restRequest.AddFile("attachment", memoryStream.ToArray(), encodedFileName, file.ContentType);
                restRequest.AddParameter("generalId", Id);
                var response = client.Execute(restRequest);