不知道你的delphi中的indy是哪个版本的?如果是老的请安装9.0以上
http://www.nevrona.com/Indy/dowload/Indy9.html
procedure TForm1.Button1Click(Sender: TObject);
var
responseStream : TStringStream;
mpfSource : TIdMultiPartFormDataStream;
begin
mpfSource := TIdMultiPartFormDataStream.Create;
responseStream := TStringStream.Create('');
try
IdHTTP1.Request.ContentType := mpfSource.RequestContentType;
mpfSource.AddFormField('var1', '1111111111111111');
mpfSource.AddFormField('var2', '2222222222222222');
mpfSource.AddFile('userfile', 'c:/a.doc', 'file');
mpfSource.PrepareStreamForDispatch;
mpfSource.Position := 0;
IdHTTP1.Post('http://serwer/test.asp', mpfSource, responseStream);
finally
mpfSource.free;
responseStream.free;
end;
end;