HTTP로 파일을 업로드 하고 싶은데 어렵네요.
inHTTP로 웹서버로부터 파일을 받는것은 되는데, 업은 안되네요.
다음 소스는 업로드하는 부분인데 오류만 발생합니다.
procedure TForm1.Button2Click(Sender: TObject);
Const 
  CRLF = '#13#10';
Var aStream: TMemoryStream;
    Params: TMemoryStream;
    S: String;
begin
    aStream := TMemoryStream.create;
    Params := TMemoryStream.Create;
    IdHTTP1.Request.Connection  := 'Keep-Alive';
    idHTTP1.Request.ContentType :='multipart/form-data; boundary=-----------------------------7cf87224d2020a';
    try
       S := '-----------------------------7cf87224d2020a' + CRLF +
             'Content-Disposition: form-data; name="file1"; filename="c:temp$$$.txt"' + CRLF +
             'Content-Type: text/plain' + CRLF + CRLF +
             'file one content. Contant-Type can be application/octet-stream or if  you want you can ask your OS fot the exact type.' + CRLF +
             '-----------------------------7cf87224d2020a' + CRLF +
             'Content-Disposition: form-data; name="sys_return_url2"' + CRLF + CRLF +
             'hello2' + CRLF + '-----------------------------7cf87224d2020a--';
       Params.Write(S[1], Length(S));
       with idHTTP1 do
       begin
           try
               idHTTP1.Post('http://localhost/test',Params,aStream);
           except on E: Exception do
               showmessage('파일업로드 에러: ' + E.Message);
           end;
       end;
       aStream.WriteBuffer(#0' ', 1);
       showmessage(PChar(aStream.Memory));
    except
    end;
end;
=================================
오류내용: 405 Method not Allowed
=================================
혹시
idHTTP1.Post('http://localhost/test',Params,aStream);
에서 사용법 틀린 부분이 있는것 같기도 한데....
부탁합니다..