Steps to reproduce the issue
1. Set 'samigo.saveMediaToDb' property to false (files will be stored in the file system).
2. Create and publish an assessment with a 'File upload' question.
3. Student takes the assessment, uploads any file to the 'File upload' question and submits the assessment.
4. The instructor clicks the 'Download file submissions' button (Total Scores page)to get a .ZIP file that contains all uploaded files.
5. The files which are inside the .ZIP are corrupted (0 bytes).
I've attached a patch to solve it.