Hi, thanks for all the suggestions.
Do you have a working example of a Laravel streamed download for a merged file?
Would it be something like this?
return response()->streamDownload(function () use ($merge) {
echo $merge->mergeDocx($queue[0], array(), 'example.docx', array());
}, 'filenamexxx');
It must has something to do with
- The DOCX file is not valid and it is not possible to open it. This is the most common issue about corrupted documents, and it means that the web server or PHP are adding extra content to the file at the beginning or the end, e.g when it is downloaded. It is possible to see those additional contents by opening the DOCX with a hex-editor. This way you can trace their origin and thus prevent them to be added.
Especially, since I am basically not adding any content to my DocX in the example. Besides the working Laravel example, are there any reknown PHP / Web Server things that generally cause these issues? E.g. are there any examples to the statement that help me pinpoint the issue?