Memory-efficient file downloads