i *think* you can also just fopen and pass the stream handle as content, to avoid memory issues with larger files. you should try that.