Error while using comment with attachment

I am trying to create CURL command to upload attachment with /REST/1.0/ticket/<ticket-id>/comment request:

@echo off

detail.txt (
curl -k -X POST -d @credentials.txt --data-urlencode content@config.txt --data-binary attachment_1@[FileName] https://[URL]/rt/REST/1.0/ticket/[ticket-id]/comment

credencial.txt is passing user and password,

content@config.txt is:

ID: [ticket-id]
Action: comment
Text: whatever
Attachment: [FileName]

attachment_1 is variable @ exact file name same as in content.

Whatever I tried with file name, paths, adding Headers (here impossible), using posting --data instead of --data-binary etc. leads me to error:

“RT/4.4.4 400 Bad Request”

“# No attachment [FileName]”

Just to mention I have to use CURL and I am currently using same request for commenting and it works. That is Key Attachment used in content variable that makes it problematic.

Please share if any idea related to uploading attachments using this request.