Attachments in Frappe Framework v15
What Are Attachments in Frappe Framework?
Attachments in Frappe Framework v15 allow users to upload, link, and manage files directly within the Frappe Desk. Attachments are associated with DocTypes and records, enabling documents such as invoices, images, contracts, or reports to be stored alongside business data in ERPNext.
Attachments are managed internally using the File DocType.
Why Are Attachments Important in ERPNext?
Attachments help centralize business documents and improve traceability across workflows.
Key Benefits
- Centralized document storage
- Contextual file access within records
- Secure, permission-based file visibility
- Reduced dependency on external storage systems
ERPNext relies on attachments for audits, compliance, and operational documentation.
Who Uses the Attachment System?
Target Audience
- ERPNext End Users
- ERP Administrators
- Frappe Developers
- Operations and Finance Teams
Technical Prerequisites
- Frappe Framework v15
- DocTypes enabled for attachments
- Appropriate user permissions
How Do Attachments Work in Frappe v15?
Attachments are uploaded through the Desk UI or via APIs and are stored as File records.
Core Components
- File DocType – stores metadata and file path
- Attached To DocType – linked document type
- Attached To Name – specific record name
Module: Desk / Database
Verified Source (v15): frappe/core/doctype/file
How to Upload Attachments from the Desk?
Step-by-Step (End User)
- Open a DocType record
- Click the Attach (paperclip) icon
- Upload a file from your system
- Save the document
The file is automatically linked to the record and stored securely.
Where Are Files Stored?
In Frappe Framework v15, files are stored:
On the server file system (default)
With metadata saved in the File DocType
Each file record contains:
- File name
- File URL
- Privacy flag (public/private)
- Linked DocType and document
Public vs Private Attachments
| Type | Visibility | Storage |
| Public | Accessible without login | /public/files |
| Private | Permission-based access | /private/files |
Private files are protected and served only to authorized users.
How Are Permissions Enforced on Attachments?
Attachment access follows Frappe’s permission model:
- Users must have access to the linked DocType
- Private files require explicit permission
- Deleted records automatically unlink attachments
This ensures secure document handling across ERPNext.
Real-World ERPNext Use Cases
Industry Relevance
- Finance: Invoice PDFs, audit documents
- HR: Employee certificates and IDs
- Manufacturing: Drawings, quality reports
- Sales: Contracts, quotations
Attachments provide critical document continuity.
Best Practices for Managing Attachments
- Use private files for sensitive documents
- Avoid uploading unnecessary large files
- Regularly review unused attachments
- Enforce role-based access
- Maintain naming consistency
Common Issues and Troubleshooting
File Not Uploading
- Check file size limits
- Verify storage permissions
- Confirm user upload rights
Attachment Not Visible
- Verify file privacy setting
- Check DocType permissions
- Ensure record is saved
Advanced Attachment Concepts
Attachments and Email Integration
Attachments can be automatically included in outgoing emails generated from DocTypes, ensuring documents like invoices or reports are shared seamlessly.
Integration Patterns
The attachment system integrates with:
DocTypes and Forms
Email notifications
Print Formats (PDF attachments)
REST APIs
ERPNext workflows
Attachments act as a core document layer in ERPNext.
Official References (Verified)
Desk Attachments Documentation (v15):
https://docs.frappe.io/framework/user/en/desk/attachments
Frappe GitHub (v15):