Fix file upload issue in dart

Fix issue where files were being corrupted on upload