해당 ICS 홈페이지 FAQ란에 내용이 있네요....
간편하게 Base64 Encoding후 데이터를 계산하는 방법등이 나와있네요..
간단하게 만들어서 해보니... 대충 맞는것 같네요..
아래는 내용입니다.
Message size
Various
21/07/2001
> I would like to be able to get an accurate size of a message before sending,
> and then be able to provide progress as it is sending. The problem I am
> having is the Base64 encoding I believe. Whenever there is an attachment,
> the data sent is greater than the actual sizes of the
> Files + MailMessage + Headers
Answer 1:
A small test on an attachment that I did, shows that the original data has a length of 60 and the encoded Base64 data has a length of 80. Said another way, the encoding process expands the data by 1/3 and the decoding process shrinks the data by 1/4.
Answer 2:
A couple of small points to add to this, depending on how accurate you need to be:
Each three bytes of raw data encodes to 4 bytes of base64. If the total length of your raw data is not an exact multiple of three, you need to round the calculation up. Thus 12 raw bytes equals 16 coded bytes; 13, 14, or 15 raw bytes all equate to 20 coded bytes.
If you use a line-based protocol to transmit the data (NNTP, Pop3 or whatever), then each line includes an additional CRLF pair. So you'd need to add (2 * linecount) to the byte-count as calculated above.
http://users.pandora.be/sonal.nv/ics/faq/Frame_index.html
zepirox 님이 쓰신 글 :
: 안녕하세요.
:
: 간단한 메일 전송 프로그램을 만들고 있는데요..
: ICS Component를 사용해서 만들고 있습니다.
:
: ICS Component 메일을 전송하는것까지는 됩니다.
: 근데 이 메일 보내는 단계를 Progress Bar로 보여 주고 싶단거죠..
:
: FlatStyle의 TFlatGauge를 사용할려고 하는데요....
:
: ProgressBar->MaxValue=
: ......
: .....
: ProgressBar->Prorgress++;
: ....
: ...
:
:
: 로 하고 있습니다.
:
: 근데 저기 MaxValue에 값을 넣어야 하는데, 그 값 구하는 법을 ICS에서는 모르겠네요..
:
: 소켓에다가 데이터를 보내고 넣는데...
:
: 현재 Email Data의(Base64 Encoding으로 했습니다)크기를 넣고 전송하는 버퍼 크기로 나눈값을 넣으면 될것도 같은데...파일 첨부가 있을경우에는 Encoding되고 난이후의 크기를 전혀 모르겠네요..
: 게시판 찾아보면, NMFTP인가..하는 ByteTotal 같은 프로퍼티도 없구요...
: 비슷한 예제나, 해결 방법 제시 부탁드립니다.
:
: 감사합니다.