This Frappe app introduces a functionality to preview file attachments directly within the Frappe framework. By adding an icon next to each attachment, users can quickly view the content of attached files without downloading them.
- Preview Dialog: Provides a dedicated icon for each attachment that opens a dialog box to preview the file when clicked.
- Draggable and Resizable Dialog: The preview dialog can be stretched, dragged, and moved for better usability.
- Supports Multiple File Types: View various file formats directly in the browser, including:
- Images (JPG, PNG, GIF, WebP)
- PDFs
- Videos
- Audio
- Text Files
- JSON Files
- XML Files
- CSV Files
- Attach & Attach Image Field Preview: Preview button also appears directly on form fields of type
AttachandAttach Image. - Child Table Support: Works inside grid/child table rows.
- Attachment Navigation: Browse between all document attachments using on-screen arrows or keyboard (← →).
- Enhanced User Experience: Saves time by allowing users to preview attachments without opening in a new tab.
Follow these steps to install and use the app:
- Clone the Repository
bench get-app https://github.com/systonium/preview-attachment.git
- Install the App
bench --site your-site-name install-app preview_attachment
- Restart Bench
bench restart
Contributions are welcome! Feel free to open issues or submit pull requests to improve this app.
- Fork the repository.
- Create a feature branch (
git checkout -b your-feature). - Commit your changes (
git commit -m "Add your feature"). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
This project combines work from multiple contributors:
- Original preview attachment functionality by Hardik Zinzuvadiya (Z4nzu)
- Side-peek drawer, attachment navigation, CSV preview, and security improvements by kardmode
- Attach / Attach Image field preview, child table support, WebP support, and UI refinements by systonium