download files from mail

B

Blanca Id

Hi,

I'm trying to download a file with net::IMAP from mail count. I can
download plain texts files using fetch method and unpack'm', but when i
try it with an excel file (vnd.ms-excel), the downloaded excel is
corrupted.

thanks for all
 
A

Artur Juve

compare the files and detect de differences

bye

Blanca said:
Hi,

I'm trying to download a file with net::IMAP from mail count. I can
download plain texts files using fetch method and unpack'm', but when i
try it with an excel file (vnd.ms-excel), the downloaded excel is
corrupted.

thanks for all
 
B

Blanca Id

Hi Artur,

I have compared the excel file download from mail with the original and
seems to be the same. I've read that can be that the LF character has
been replaced with CRLF characters, so the download file size is
diferent.

thanks
 
B

Blanca Id

Hi,

At last I found the solution, to download correctly excel files I use
the 'wb' instead of 'w' on the open parameters.

if body.subtype == "PLAIN"
File.open(nameFile,'w')
f.write(file)
end
else
File.open(nameFile,'wb')
f.write(file)
end
end

bye
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,197
Messages
2,571,040
Members
47,634
Latest member
RonnyBoelk

Latest Threads

Top