From 437661e2a621cb0b46108b99601fb4a4fd2d3fa1 Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Fri, 23 Jan 2026 15:41:36 +0100 Subject: [PATCH] chore(client): add verbose error logging for file upload debugging on iOS --- client/src/pages/new-reel.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/client/src/pages/new-reel.tsx b/client/src/pages/new-reel.tsx index 7905624..21641fb 100644 --- a/client/src/pages/new-reel.tsx +++ b/client/src/pages/new-reel.tsx @@ -195,15 +195,28 @@ export default function NewReel() { }, }); - const onDrop = useCallback((acceptedFiles: File[]) => { + const onDrop = useCallback((acceptedFiles: File[], fileRejections: any[]) => { + if (fileRejections.length > 0) { + console.error('❌ Fichiers rejetés:', fileRejections); + const rej = fileRejections[0]; + toast({ + title: "Fichier non supporté", + description: `Type détecté: ${rej.file.type || 'Inconnu'}. Erreur: ${rej.errors?.[0]?.message}`, + variant: "destructive", + }); + return; + } + if (acceptedFiles.length > 0) { const file = acceptedFiles[0]; - if (file.type.startsWith('video/')) { + console.log('✅ Fichier accepté:', file.type, file.size); + // Accepter aussi formats iOS sans type MIME standard + if (file.type.startsWith('video/') || file.name.toLowerCase().endsWith('.mov') || file.name.toLowerCase().endsWith('.mp4')) { uploadMutation.mutate(file); } else { toast({ title: "Format invalide", - description: "Veuillez sélectionner un fichier vidéo", + description: `Fichier non reconnu comme vidéo (${file.type || 'sans type'}). Essayez MP4/MOV.`, variant: "destructive", }); }