nylas / nylas-mail

:love_letter: An extensible desktop mail app built on the modern web. Forks welcome!
https://nylas.com/nylas-mail/
MIT License
24.8k stars 1.39k forks source link

XLSX and DOCX files are corrupted when downloaded #1240

Open xescugc opened 8 years ago

xescugc commented 8 years ago

I have a issue on OSX when downloading XLSX files attached on the email, it downloads them as malformed and there is no way to open them, I have to go to Gmail and download them from there.

N1 version: Version 0.4.5-b0ec335 (0.4.5-b0ec335) OSX version: 10.10.5

bengotow commented 8 years ago

Hi @XescuGC — I've sent myself a few XLSX attachments and I haven't been able to reproduce this on Mac OS X. There are a couple things that could be going on here. There might be something specific about the file that is causing it to become corrupted, or it might be strangely encoded in the mime-part data of the message body, causing our sync-engine to build the attachment wrong. Could you try narrowing this down a bit? Maybe it's reproducible with a specific file, or only happens when you send the messages with a specific mail client?

xescugc commented 8 years ago

Hi @bengotow,

I've tested to download the file from Gmail and send it to me and open it via N1, and it download it with the correct format.

Here I past you the RAW content of the attached file in booths emails:

N1 download as corrupted:

Date: Tue, 9 Feb 2016 09:24:26 +0100
MIME-Version: 1.0
Content-Type:
 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;
 name="name.xlsx"
Content-Disposition: attachment; filename="name.xlsx"
Content-Transfer-Encoding: base64

Send it from Gmail:

Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; 
    name="gmail.xlsx"
Content-Disposition: attachment; filename="gmail.xlsx"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ikf5sq160

Another thing to consider is that when i've download the email from Gmail and N1 (the one that N1 flags as corrupted) the size from the document downloaded from Gmail was: 216KB and the one downloaded from N1 was: 427KB

If you need more information just ask :) (if you want the HEADERS from the email just ask for them :+1: )

bengotow commented 8 years ago

Hey @XescuGC — thanks, this is perfect! I'm flagging this for our sync engine team to take a look at, and we'll let you know if we need anything else to get it fixed. Cheers,

jackiehluo commented 8 years ago

Happening in #2267!