From a7b6c1ca3de95e88ae1972fe29c6f998df6fda4f Mon Sep 17 00:00:00 2001 From: Anna Zabolotskaya Date: Tue, 9 Apr 2024 16:47:21 +0200 Subject: [PATCH] encode file name --- FunctionApp/UploadDocumentToLoxo.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FunctionApp/UploadDocumentToLoxo.cs b/FunctionApp/UploadDocumentToLoxo.cs index bf93132..9bb2dd0 100644 --- a/FunctionApp/UploadDocumentToLoxo.cs +++ b/FunctionApp/UploadDocumentToLoxo.cs @@ -60,8 +60,9 @@ public async Task Run( using (var content = new MultipartFormDataContent()) { var fileContent = new ByteArrayContent(fileData); + var fileName = Uri.EscapeDataString($"Filled in form ({DateTime.Now}).pdf"); fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); - content.Add(fileContent, "document", $"Filled in form ({DateTime.Now}).pdf"); + content.Add(fileContent, "document", fileName); var postResponse = await httpClient.PostAsync( $"https://app.loxo.co/api/{_settings.AgencySlug}/people/{personId}/documents", content);