Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Jul : HTTP-Upload and Server-Error 405. Please help
| Subject: | HTTP-Upload and Server-Error 405. Please help |
| Posted by: | "Boris Nienke" (nospam@nsonic.de) |
| Date: | Thu, 7 Jul 2005 15:24:11 |
Hi,
yes i know there are tons of postings out there dealing with http-upload.
But i've searched the whole day long and didn't found an answere :'(
Problem:
- i need to upload a binary file to a webserver.
- The address is for example "http://127.0.0.1/uploads/"
i've tried Indy:
procedure TForm1.Button1Click(Sender: TObject);
var
fs : TFileStream;
ResponseStream: TMemoryStream;
begin
ResponseStream := TMemoryStream.Create;
fs := TFileStream.Create(edit1.text, fmOpenRead or fmShareDenyWrite);
try
IdHTTP1.Post('http://127.0.0.1/uploads', fs, ResponseStream);
finally
fs.Free;
ResponseStream.Free;
end;
end;
When i try this i get and Server error "405"
I've tried "Synapse" too with the same result:
ms := TMemoryStream.Create;
ms.LoadFromFile(edit1.text);
ms.Seek(0,0);
HttpPostBinary(edit2.text, ms);
any help is appreciated. I simply need to upload a file to a place on the
server... :'(
Boris