Fix Attachment Preview Issues Caused by Incorrect Content‑Type
If you’re facing issues with attachment previews in BoldDesk, it may be due to an incorrect Content-Type header used during file upload via the API. This article explains the cause and how to resolve it.
What Causes the Issue
When uploading files through the API, the system relies on the Content-Type header to identify the file format. If this header is incorrect or missing, the preview functionality may not work as expected.
For example: The appropriate Content-Type for a PDF file is application/pdf, whereas application/json or other unrelated types are incorrect.
How to Fix It
To ensure attachments preview correctly:
- Always set the appropriate Content-Type based on the file type.
- Confirm that your API request includes the correct header.
Example for PDF Upload - Content-Type: application/pdf
You may refer to the extension and type listed below.
| Extension | MIME Type |
|---|---|
| application/pdf | |
| .json | application/json |
| .jpg/.jpeg | image/jpeg |
| .png | image/png |
| .csv | text/csv |
| .txt | text/plain |
FAQs
Q1: Can BoldDesk fix an incorrect Content‑Type after the file is uploaded?
No. BoldDesk uses the MIME sent at upload time. Re-upload the file with the correct Content‑Type to enable preview.
Q2: Do file extensions alone control the preview?
No. BoldDesk primarily relies on the Content‑Type header from the upload request. The extension helps, but a wrong MIME type can still break previews.
Q3: Does BoldDesk support preview for all file types?
No. Only previewable formats (e.g., PDF, common images, text/CSV) render inline. Others can still be uploaded and downloaded.