Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
download files from mail
Blanca Id
10/28/2008 12:14:00 PM
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
--
Posted via
http://www.ruby-...
.
3 Answers
Artur Juve
10/28/2008 4:51:00 PM
0
compare the files and detect de differences
bye
Blanca Id wrote:
> 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
--
Posted via
http://www.ruby-...
.
Blanca Id
10/28/2008 4:56:00 PM
0
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
Artur Juve wrote:
> compare the files and detect de differences
>
> bye
--
Posted via
http://www.ruby-...
.
Blanca Id
10/28/2008 5:34:00 PM
0
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
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
download files from mail
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password