Solved Email attachment download "Word found unreadable content in 8qqrwPwAl3HRa01d.docx"
All Microsoft Office XML versions (docx, pptx, xlsx, etc) when downloaded show an error " Word found unreadable content in 8qqrwPwAl3HRa01d.docx. Do you want to recover the contents of this document? If you trust the source of this document, click Yes. ".
Is this a known issue?
Any office file with the x extension is downloading corrupted. Has anyone had this issue with CentOS 7?
Hi @Brandon-2021 thank you for your post. A staff member will reply you asap. Sorry for the delay.
Your post was in the moderation queue. I informed UVdesk team about your post anyway they will check forum soon.
If no reply feel free to update me here but be sure a reply will arrive.
Please be sure to use the latest UVdesk version https://github.com/uvdesk/community-skeleton/releases/tag/v1.0.13 check also if you have some particular error log file.
Please share the original file with the same extension we will test if there is any issue from our side.
@Sanjeev Hi, which file are you referring to? If you are asking for one of the corrupt files any file saved as docx (Word), xlsx (Excel), pptx (Powerpoint) returns corrupt. When you create a simple file with a sentence in it, save, upload, download it is still readable. However, you get this error window when opening. .
Forgive me if I am finding the version in the wrong file (CHANGELOG-1.0.md), but the version is * 1.0.12 (2020-07-27).
- File uploads as an attachment with no issue.
- When I download the file after uploading it to the server via FTP (file with the new name) no issue.
- When trying to download the file on the ticket page the file is corrupt.
- I tried editing the page HTML to just download the file and not opening a new tab, still corrupt.
Not sure if the issue is with the route URL link for the download or server permissions. I tried this on a CentOS 7 server as well as a Ubuntu 20.04 server, same issue on both.
I also looked for an error log but couldn't see anything, if there is a specific log I should be looking at please let me know.
@Sanjeev I also just tried the same steps on the UV-Desk demo page and the file is corrupt as well.
I have found and corrected the issue.
In these two files
In the function "public function downloadAttachment(Request $request)", add the this line of code:
- $response->headers->set('Content-Length', $attachment->getSize());
- $response->headers->set('Content-Disposition', 'attachment; filename='. $attachment->getName());
@peopleinside Thanks again for the help!
@Brandon-2021 congratulations! Let wait developers check this and add as official fix. Waiting a feedback from @Sanjeev than I will patch also my install. Thank you very much for this report and for sharing also a solution!
Are you a programmer?
I want be also good as you to fix code but I'm not ^_^
Stay safe, take care and have a wonderful time!
@peopleinside Not a problem, I am a programmer and just glad to help out!
Thanks for your contribution !!!
We have updated your suggested line of code in our project master branches you can check.
Hope you will contribute the same in near future for this opensource project.
Stay tuned with us here we are also adding new features with this project as well.
@Brandon-2021 I'm so happy you joined and fixed one issue no one was aware of.