Skip to content

Commit 34fb32e

Browse files
committed
Fix broken Attachment#save (github #14).
1 parent 153b89c commit 34fb32e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/mapi/base.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def data
3030
# a.save open(File.basename(a.filename || 'attachment'), 'wb')
3131
def save io
3232
raise "can only save binary data blobs, not ole dirs" if @embedded_ole
33-
data.each_read { |chunk| io << chunk }
33+
data.rewind
34+
io << data.read(8192) until data.eof?
3435
end
3536

3637
def inspect

0 commit comments

Comments
 (0)