added streaming support for large files