01-07-2017, 02:29 PM
Hi,
My brother in law had a problem with checking out files. When he did that and downloaded the file he could not open it. The file was corrupted. He already discovered that there was a single byte (space) added to file file at the first position.
After some investigation i discovered the problem. The php code just returns the file that fine. The only problem is that the buffer was not empty and that is contained a single space. So a space is returned with the file content attached. So maybe it's a good idea to clear the buffers just before the php code returns the file, so it will works always. But were is the space coming from? In this case it was inside the dutch php language file. The first spot in the file, outside the php tags there is a space. Removing the space character solved the issue in this case.
Regards,
Arjan de Vries
My brother in law had a problem with checking out files. When he did that and downloaded the file he could not open it. The file was corrupted. He already discovered that there was a single byte (space) added to file file at the first position.
After some investigation i discovered the problem. The php code just returns the file that fine. The only problem is that the buffer was not empty and that is contained a single space. So a space is returned with the file content attached. So maybe it's a good idea to clear the buffers just before the php code returns the file, so it will works always. But were is the space coming from? In this case it was inside the dutch php language file. The first spot in the file, outside the php tags there is a space. Removing the space character solved the issue in this case.
Regards,
Arjan de Vries