Sending file fails with 415 Unsupported media type "application/pdf" in request

Describe the problem/error/question

I have a file from the “Google drive Download file” node.
I am uploading it to a local service (paperless-ngx) using Http post.

What is the error message (if any)?

Error 415 with the following message:
Unsupported media type “application/pdf” in request.

Please share your workflow

{
“nodes”: [
{
“parameters”: {
“pollTimes”: {
“item”: [
{
“mode”: “everyHour”
}
]
},
“triggerOn”: “specificFolder”,
“folderToWatch”: {
“__rl”: true,
“value”: “1onWNQgekpubgGfdghfgkyV9i1BUod_cS”,
“mode”: “list”,
“cachedResultName”: “n8nUploads”,
“cachedResultUrl”: “https://drive.google.com/drive/folders/1onWNQgekpubgGfdghfgkyV9i1BUod_cS
},
“event”: “fileCreated”,
“options”: {
“fileType”: “all”
}
},
“type”: “n8n-nodes-base.googleDriveTrigger”,
“typeVersion”: 1,
“position”: [
-1000,
-140
],
“id”: “6f84dae5-5ce5-485f-adec-7ebb046a5af8”,
“name”: “Google Drive Trigger”,
“credentials”: {
“googleDriveOAuth2Api”: {
“id”: “CJ923423BGMUPmT”,
“name”: “Google Drive account”
}
}
},
{
“parameters”: {
“method”: “POST”,
“url”: “http://192.168.178.56:7001/api/documents/post_document/”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpBasicAuth”,
“sendBody”: true,
“contentType”: “binaryData”,
“inputDataFieldName”: “data”,
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
-560,
-140
],
“id”: “4dc15801-90e3-4a79-907d-1a950ea8e95a”,
“name”: “HTTP Request”,
“credentials”: {
“httpHeaderAuth”: {
“id”: “alQ0uQnoLADRT2RT”,
“name”: “Paperless-ngx Auth Header”
},
“httpBasicAuth”: {
“id”: “txZ7PHgI0bAAGN8V”,
“name”: “Paperless basic auth”
}
}
},
{
“parameters”: {
“operation”: “download”,
“fileId”: {
“__rl”: true,
“value”: “={{ $json.id }}”,
“mode”: “id”
},
“options”: {
“binaryPropertyName”: “data”
}
},
“type”: “n8n-nodes-base.googleDrive”,
“typeVersion”: 3,
“position”: [
-780,
-140
],
“id”: “8bf0ae8a-04f5-43f9-b27b-738b3393778d”,
“name”: “Google Drive”,
“alwaysOutputData”: true,
“credentials”: {
“googleDriveOAuth2Api”: {
“id”: “CJ234ihedfLPBGMUPmT”,
“name”: “Google Drive account”
}
}
}
],
“connections”: {
“Google Drive Trigger”: {
“main”: [
[
{
“node”: “Google Drive”,
“type”: “main”,
“index”: 0
}
]
]
},
“HTTP Request”: {
“main”: [

]
},
“Google Drive”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “4c55062d3e194b0486de39e5d2da2726f09f5b23f9db7da042b917686d359828”
}
}

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

{
“errorMessage”: “Your request is invalid or could not be processed by the service”,
“errorDescription”: “Unsupported media type "application/pdf" in request.”,
“errorDetails”: {
“rawErrorMessage”: [
“415 - "{\"detail\":\"Unsupported media type \\\"application/pdf\\\" in request.\"}"”
],
“httpCode”: “415”
},
“n8nDetails”: {
“nodeName”: “HTTP Request”,
“nodeType”: “n8n-nodes-base.httpRequest”,
“nodeVersion”: 4.2,
“itemIndex”: 0,
“time”: “26/04/2025, 3:13:03 pm”,
“n8nVersion”: “1.88.0 (Self Hosted)”,
“binaryDataMode”: “default”,
“stackTrace”: [
“NodeApiError: Your request is invalid or could not be processed by the service”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:597:21)“,
" at processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:681:27)“,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:915:51”,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1246:20"
]
}
}

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Managed to fix the issue.
I didnt read up the API properly

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.