@czhower Fixed this part as follows:
1 - Removed all the text from Responses
2- In the Command Handlers add ASender.Reply.SetReply(200, '[success]')
3 - In the client use
a) Memo1.Lines.Add(intToStr(Client.LastCmdResult.NumericCode));
b) for I := 0 to Client.LastCmdResult.Text.Count -1 do Memo1.Lines.Add(Client.LastCmdResult.Text[i]);
No more '.' (periods). Thanks
ParentPart = -1
), though that is not guaranteed. Usually non-body attachments are inside a multipart/mixed
MIME part (also not guaranteed). Body-related attachments should be in a multipart/related
MIME part along with the body that refers to them.
Read()
/Write()
methods to track howw many bytes are being processed (for instance, Indy's TIdEventStream
)
IdGlobal
unit
IdCompressorZLib
wrapper, which doesn't expose progress (because it is not meant to be used directly, it is used by TIdHTTP
)
@rlebeau @mezen
Body-related attachments should be in a multipart/related MIME part along with the body that refers to them.
So, if I want to get all attachments but not body-related ones, I guess I need to test like this:
// ...
else if part.PartType = mptAttachment then
begin
// get attachment, if it's NOT body-related
if not IsHeaderMediaType(part.ContentType, 'multipart/related') then
mail.AddAttachment(TIdAttachment(part));
end;
Am I right?
else if part.PartType = mptAttachment then
begin
if (
(part.ParentPart = -1) and not IsHeaderMediaType(mail.ContentType, 'multipart/related')
)
or (
(part.ParentPart <> -1) and not IsHeaderMediaType(mail.MessageParts[part.ParentPart].ContentType, 'multipart/related')
) then
mail.AddAttachment(TIdAttachment(part));
end;
var
ct: string;
...
else if part.PartType = mptAttachment then
begin
if part.ParentPart = -1 then
ct := mail.ContentType
else
ct := mail.MessageParts[part.ParentPart].ContentType;
if not IsHeaderMediaType(ct, 'multipart/related') then
mail.AddAttachment(TIdAttachment(part));
end;