I was handed over a site for maintenance/enchancement. The site's platform is running on PHP5, older version of OpenCart (1.5.x).
There is a part where the user is able to download image files using a jquery-based file manager to display files from the /image/ folder.
What happens is that the image file after download fails to load in any image editor/viewer application. When I examined the file with a hex editor, I found out that the start of the JPEG or PNG files starts with a 0x0A (a carriage return). This is the one that is causing the image to fail to be read properly, but how it got there has stumped me since this morning.
There is a testing site on another server with a similar setup. The images can be downloaded and opened correctly. The code should be the same. This part was not touched so I am at a loss on why this happens on Live but not on Testing site.
Has anybody encountered this before, and what is the fix?
Thanks!