Page 1 of 1

Image Attachments Used to Work Now Corrupted

Posted: Thu Mar 17, 2011 10:42 pm
by aaron.lee
Script URL: Internal
Version of script: 2.3
Hosting company: Self
URL of phpinfo.php: NA
URL of session_test.php: NA
What terms did you try when SEARCHING for a solution:
attachments, image

Write your message below:
Hesk has been working without complications since version 1.x. Hesk accepts attachments, stores them, and retreives them. Recently, certain file type, docx or any image file type are corrupted when viewed from Hesk. When openning directly from the server's folder in the Hesk directory they view normally. It appears that something in the way the download_attachment.php writes the file is corrupting the attachments. PDF and CSV files open as desired.

To the best of my knowledge no software has been installed recently on the server. Any guesses what would be causing this?

Re: Image Attachments Used to Work Now Corrupted

Posted: Sat Mar 19, 2011 11:23 am
by Klemen
Have you upgraded Hesk recently?
How do you know the images/files get corrupted, do you get any error messages?
Do the images get corrupted if you view them from the customer side?
What browser are you using? Can you try downloading with another browser?
Does this happen for all docx files or just certain ones?
Does this happen if you disable your antivirus?

Re: Image Attachments Used to Work Now Corrupted

Posted: Mon Mar 21, 2011 6:25 pm
by aaron.lee
No, no recent upgrades. I had upgraded to 2.2 last year.

So far all docx files display this behavior. The docx says, "The <filename> cannot be opened because there are problems with the contents." Clicking details, "The file is corrupt and cannot be opened." Clicking OK, "Word found unreadbale content in <filename>. Do you want to recover the contents of this document? If you trust the source of this document, click Yes." Clicking Yes, in most cases will recover the docx and saving it again will fix the file header.

All image files, gif, jpg, tif, etc. when opened in their native viewer will return an error. In Windows Photo Viewer, "Windows Photo Viewer can't open this picture because the file appears to be damaged, corrupted, or is too large." (The most recent is only 13.4KB.) Opening in Internet Explorer, only provides the red X for a missing image. Results are the same saving the file to the hard drive first before viewing. I've also tried opening with Paint, Paint.NET, MS Office Picture Manager, and Windows Media Center. The orginal from the attachments folder will open as intended, while the download copy does not.

These have been tested so far on Windows XP, 7 32 bit, and 7 64 bit. Anti-virus disable does not correct it. It has been tested in IE 8 and FireFox 3.6. Results are the same on the customer side as well.

After several teardown and rebuild efforts, the problem was in the langauge file. "text.php" Oddly enough replacing this file, with the orginal, has corrected the problem. Postmortem identified lines [nti3] and [seno] as having verbage altered from the original.

Thanks for your help. Great application!

Re: Image Attachments Used to Work Now Corrupted

Posted: Tue Mar 22, 2011 4:34 pm
by Klemen
Thanks for the feedback, I'm gald you found the problem. I guess errors in the text files were messing with file headers.