File Attachments
Allow customers to share files directly in chat conversations. ChatterMate supports secure file uploads with configurable file types, size limits, and storage options.Enabling File Attachments
File attachments are configured per agent. To enable:Supported File Types
Images
Supported formats:
- JPEG / JPG
- PNG
- GIF
- WebP
Documents
Supported formats:
- Microsoft Word (.doc, .docx)
- Microsoft Excel (.xls, .xlsx)
- Plain Text (.txt)
- CSV (.csv)
File Type Reference
| Category | Extensions | MIME Types | Max Size |
|---|---|---|---|
| Images | .jpg, .jpeg, .png, .gif, .webp | image/jpeg, image/png, image/gif, image/webp | 5MB |
| application/pdf | 10MB | ||
| Word | .doc, .docx | application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document | 10MB |
| Excel | .xls, .xlsx | application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | 10MB |
| Text | .txt, .csv | text/plain, text/csv | 10MB |
SVG files are intentionally excluded from supported types due to potential XSS (Cross-Site Scripting) security vulnerabilities.
Security Features
ChatterMate implements multiple layers of security for file uploads:Magic Byte Validation
Files are validated by their binary signature (magic bytes), not just MIME type or extension. This prevents file type spoofing.
Size Limits
Strict file size limits are enforced server-side to prevent abuse and ensure system stability.
Type Restrictions
Configure allowed file types per agent to only accept what you need.
Signed URLs
File downloads use temporary signed URLs that expire, preventing unauthorized access.
How Magic Byte Validation Works
Unlike simple MIME type checking, magic byte validation reads the actual file header to verify its true type:Storage Configuration
AWS S3 (Production)
For production deployments, files are stored in AWS S3:Local Storage (Development)
For local development, files are stored on the filesystem:Agent Configuration
Enable All Attachments
Restrict to Specific Types
Limit uploads to specific categories:User Experience
Upload Flow
When file attachments are enabled, users can:- Click the attachment icon in the chat input
- Select files from their device
- Preview images before sending
- See upload progress indicator
- View attached files in chat history
Chat Interface
Image Previews
Images display as inline previews in the chat with click-to-expand functionality.
Document Links
Documents appear as downloadable links with file name and size displayed.
Best Practices
-
Enable Only What You Need
- If you only need image uploads, restrict to images only
- Reduces potential attack surface
- Improves user experience with focused UI
-
Monitor Storage Usage
- Track file storage consumption
- Set up alerts for unusual upload patterns
- Implement retention policies for old files
-
Consider File Processing
- Large files may impact chat performance
- Consider async processing for document analysis
- Compress images when possible
-
Inform Users
- Display accepted file types in the UI
- Show clear error messages for rejected files
- Indicate file size limits
Troubleshooting
File upload fails with 'Invalid file type'
File upload fails with 'Invalid file type'
- Verify the file extension matches the actual file type
- Check if the file type is in the allowed list
- Ensure the file hasn’t been renamed with a different extension
- Try re-exporting the file from its source application
Upload fails with 'File too large'
Upload fails with 'File too large'
- Check file size against limits (5MB images, 10MB documents)
- Compress images before uploading
- Split large documents into smaller parts
Uploaded files not appearing
Uploaded files not appearing
- Verify S3 credentials are configured correctly
- Check S3 bucket permissions
- Ensure CORS is configured on your S3 bucket
- Review backend logs for storage errors
Cannot download uploaded files
Cannot download uploaded files
- Signed URLs may have expired (refresh the chat)
- Check S3 bucket access policies
- Verify the file wasn’t deleted from storage
What’s Next?
After enabling file attachments:- Test upload functionality with various file types
- Configure file type restrictions as needed
- Set up S3 storage for production
Widget Apps
Learn about deploying and customizing widget apps