Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Jul : IdHttp uploaded files 2 bytes too large
| Subject: | IdHttp uploaded files 2 bytes too large |
| Posted by: | "Martin Unland" (munla..@abakon.de) |
| Date: | Wed, 6 Jul 2005 12:20:10 |
Hello,
when I upload a file via TIdHttp and TIdMultiPartFormDataStream the
size of the uploaded file is 2 bytes too large. A cr/lf is added to the
file.
The essential code is:
FormData := TIdMultiPartFormDataStream.Create;
FormData.AddFile('file', aFileName, 'application/x-zip-compressed');
IdHTTP.Post(aUploadUrl, FormData);
Is there an error in IdMultiFormData.pas at line 418:
function TIdFormDataField.GetFieldSize: LongInt;
begin
...
if FieldObject is TStream then
FFieldSize := FFieldSize + FieldStream.Size + 2;
end;
Result := FFieldSize;
end;
I use Indy V9 and Delphi7
Regards,
Martin