Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 22624, Simulating http file upload using Indy.

by Patrik Spanel Email: Anonymous


In memory file construction and upload by http POST method.
Download Details
FTP  download also available
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Delphi, Version 7.0  to 7.0 487 downloads
Copyright: No significant restrictions


Size: 2,093 bytes
Updated on Tue, 12 Oct 2004 07:04:04 GMT
Originally uploaded on Tue, 12 Oct 2004 06:56:31 GMT
SHA1 Hash: C41D623896B27C2B8B86A70601D6FC586CD67FCA
MD5 Hash: 3C409F5270AC2A7579A3FDC0CB0B8F92

    Explore the files in this upload

Description
procedure TForm1.Button1Click(Sender: TObject);
var
MultiPartFormDataStream: TIdMultiPartFormDataStream;
begin
MultiPartFormDataStream := TIdMultiPartFormDataStream.Create;
try
IdHttp1.Request.ContentType := MultiPartFormDataStream.RequestContentType;
MultiPartFormDataStream.AddFormField('password', 'ann');
MultiPartFormDataStream.AddObject('file[]','',TStringStream.Create(memo2.Text) ,'memo2.txt');
MultiPartFormDataStream.Position := 0;
Memo1.Text:= IdHttp1.Post(HOSTNAME+'?method=upload', MultiPartFormDataStream);
finally
MultiPartFormDataStream.Free;
end;
end;

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Server Response from: ETNACDC03