IBM has posted a support document describing the various ways to put a file as a message to a queue.
https://www.ibm.com/support/pages/node/6409594
I would like to point out that both MQ Visual Edit and MQ Batch Toolkit can put a file as a message to a queue.
MQ Visual Edit is a GUI program, so you simply point and click to load the files as messages to a queue whereas MQ Batch Toolkit is designed to be run from a command-line or script.
Both programs are available for Windows, macOS (Mac OS X), Linux 64-bit and Raspberry Pi (ARM).
A long time ago, I posted C source code (and compiled version for Windows) for 2 programs called: File2Msg and Msg2File. File2Msg will put a file as a message to a queue and Msg2File will write the contents of a message to a file. Basic stuff, but they get the job done.
Regards,
Roger Lacroix
Capitalware Inc.