Category / Section
Attachment Preview Issue Due to Incorrect Content-Type in API Request
1 min read
Updated:
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/jsonl |
.jpg/.jpeg | image/jpeg |
.png | image/png |
.csv | text/csv |
.txt | text/plain |