Hello @Jona,
welcome to this moderated Azure community forum.
As you can see in this code example, the body of an Event Hub message is just a byte array, so you can send everything you want as long as you convert it to a byte array.
You could send either each line separately (eg. as JSON) or you could send the complete file at once (if it fits).
What is needed to send a file?
You need to read the whole file and put it into the message body as a byte array.
The filename could then be added in the application properties.
This means the receiver of the message must know how to construct the file back from the message (turn the byte array into a string, construct a file out of it and give it the proper name).
The maximum message size of an Event Hub message is 1 Mb.
This could be a compressed message (eg. GZIP of Deflate) so the original file could be much larger at first. As you can see, you can test for the size using the batching method.
If this size is not enough, you could store the file in a blob storage first and only forward de location and name. Then the file size is not a limitation anymore.
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.