🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #2753

Re: MIME Encoding and TFileStream error

#2753
From: Hans Galema
Date: Mon, 30 Jan 2006 10:04
20 lines
1901 bytes
Mr. Wuf wrote:
> Sorry, my next problem: I need to transfer a binary file as a string. When I
> decode the base64 string to a TFileStream I get corrupted files!

Seeing your code you mean: I did base64 encode the contents of a file. And
no I try to decode it to a stream.

>   TFileStream *FStream = new TFileStream("C:\\test.png", fmCreate |
> fmOpenReadWrite);
>   IdDecoderMIME1->DecodeToStream(Memo1->Text,FStream);
> //  FStream->Size = 130677;  // original filesize: 130677, size of corrupted
> file: 140768
>   delete FStream;

Corrupted ? It is longer yes. But what do contain the first 130677 bytes ?
The original file contents ?

What is in the result file ? Dit you look in it ?

Hans.
Technical Details
Message-ID: <43dde47b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <43dd0b59@newsgroups.borland.com> <43dd2315$1@newsgroups.borland.com> <43dd2424$1@newsgroups.borland.com> <43ddd7f8$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,8c23835e94ef54bb
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 30 Jan 2006 11:04:07 +0100
From: Hans Galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: MIME Encoding and TFileStream error
References: <43dd0b59@newsgroups.borland.com> <43dd2315$1@newsgroups.borland.com> <43dd2424$1@newsgroups.borland.com> <43ddd7f8$1@newsgroups.borland.com>
In-Reply-To: <43ddd7f8$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 145.98.201.248
Message-ID: <43dde47b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1138615419 145.98.201.248 (30 Jan 2006 02:03:39 -0700)
Lines: 20
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail