How much content is it exactly?
Does the fwrite() function you are using have a length value in the parameters? It would look similar to this:
fwrite($fp, $val, 1024);
If there is a number there, it should be expanded or removed - based on your needs.
Otherwise, you might be right. There could be an undocumented limit to fwrite().