This isn't used anywhere other than for testing and I am new to Indy/Delphi. But your comment didn't tell me anything that was helpful. If you are referring to the excessive try blocks or "Delay()" Please give me any suggestions. The Delay is really a replacement for sleep used here.
procedure Delay(TickTime: Integer);
var
Past, Present: LongInt;
begin
Past := GetTickCount;
repeat
if MsgWaitForMultipleObjects(0, Pointer(nil)^, FALSE, (TickTime - Present), QS_ALLINPUT) <> WAIT_OBJECT_0 then Break;
Application.ProcessMessages;
Present := (GetTickCount - Past);
until ( Present >= LongInt(TickTime) );
end;
I normally do not need call a "delay" but here it it seemed to allow for the file to be loaded into a TStream as a Multipart form file field. So this was just attempt at that.
I have not used Indy IdHTTP before this and I have no issues writing to files using TFileStream, but it seemed like in this case I needed to wait before Posting the file.