From 3fcabdde257d467445aa7e03fc4c4ce716b9ad99 Mon Sep 17 00:00:00 2001 From: alma Date: Sun, 20 Apr 2025 20:58:24 +0200 Subject: [PATCH] carnet panel contact --- app/api/nextcloud/files/route.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/nextcloud/files/route.ts b/app/api/nextcloud/files/route.ts index 8aca63f7..edc26a55 100644 --- a/app/api/nextcloud/files/route.ts +++ b/app/api/nextcloud/files/route.ts @@ -149,7 +149,9 @@ export async function PUT(request: Request) { const path = `/files/${username}/Private/${folder}/${title}`; console.log('Updating file at path:', path); - await client.putFileContents(path, content); + // Set the correct content type based on file extension + const contentType = title.endsWith('.vcf') ? 'text/vcard' : 'text/markdown'; + await client.putFileContents(path, content, { contentType }); // Get the updated file details const fileDetails = await client.stat(path);