Bug #3234
Incorrect File Download Behavior on Document Verification Page
Description
When a user clicks the "View" action (eye icon) for a document, the system downloads the file directly instead of opening like a panel . so fix this issue .
Added by Shreya Agarwal 13 days ago. Updated 13 days ago.
Description
When a user clicks the "View" action (eye icon) for a document, the system downloads the file directly instead of opening like a panel . so fix this issue .
On the /document-verification page, clicking the eye button in the Actions column previously triggered unwanted direct file downloads or opened raw S3 media URLs in a new browser tab. Additionally, direct access to private S3 files resulted in AWS AccessDenied XML errors due to missing signature parameters. To resolve this, I implemented an in-app Document Preview Modal that fetches temporary pre-signed URLs dynamically via the backend API (getDocumentViewUrl), ensuring secure access and eliminating all access denial issues.
The preview modal dynamically identifies the document type from API responses: standard image formats (PNG, JPG, WEBP, etc.) are rendered using a centered, responsive image viewer with aspect-ratio preservation and auto-overflow handling, while PDF files are displayed in an embedded viewer supporting multi-page reading. The modal styling was aligned with the project's branding system (useBrandingStyles), applying the tenant's primary colors, clean card borders, and standard button designs (primaryButtonStyle and secondaryButtonStyle) while removing duplicate controls and redundant status chips. Furthermore, the download handler was upgraded to use direct blob streaming (fetch
-> clicking "Download" immediately saves the original file directly to the user's local machine without navigating or opening new browser tabs.