diff --git a/components/FilePreviewModal.vue b/components/FilePreviewModal.vue index 33acb2a..82fd2e8 100644 --- a/components/FilePreviewModal.vue +++ b/components/FilePreviewModal.vue @@ -158,7 +158,9 @@ const loadPreview = async () => { // For images and PDFs, use the proxy endpoint to avoid CORS issues if (isImage.value || isPdf.value) { // Use the proxy endpoint that serves the file directly - previewUrl.value = `/api/files/proxy-preview?fileName=${encodeURIComponent(props.file.name)}`; + const proxyUrl = `/api/files/proxy-preview?fileName=${encodeURIComponent(props.file.name)}`; + console.log('Setting preview URL to:', proxyUrl); + previewUrl.value = proxyUrl; // The loading state will be handled by the image/iframe onload event } else { throw new Error('File type does not support preview'); @@ -170,7 +172,9 @@ const loadPreview = async () => { }; // Handle preview load error -const handlePreviewError = () => { +const handlePreviewError = (event: any) => { + console.error('Preview load error:', event); + console.error('Current preview URL:', previewUrl.value); error.value = 'Failed to load preview'; loading.value = false; };