Jump to content

Fuandi

Members
  • Content Count

    7
  • Joined

  • Last visited

Posts posted by Fuandi


  1. Hi all,

    Currently i'm able to upload a file from my local drive to amazon s3 bucket.  But when I want to upload it into the folder inside the bucket, it will give me error.

    Anyone can help ?

     

    let say the bucket name is bucket1

    and the folder inside that bucket is folder1

     

    I tried this

            Service.UploadObject('bucket1/folder1', ExtractFileName(fileName), bytes, TRUE, nil, nil, amzbaPrivate, info);
     

     

     


  2.  

    Yes, I already removed it. Below is my code.

     

    procedure TForm1.Button1Click(Sender: TObject);
    var
      xRequestBody: TStringList;
    begin
      IdOpenSSLSetLibPath(ExtractFilePath(ParamStr(0)));

      IdSSLIOHandlerSocketOpenSSL1.sslOptions.VerifyMode := [];
      IdSSLIOHandlerSocketOpenSSL1.sslOptions.VerifyDepth := 0;

      IdSSLIOHandlerSocketOpenSSL1.sslOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];

     

      objHTTP.handleredirects := True;
      with objHTTP.Request do
      begin
        Clear;
        UserAgent := 'Mozilla/3.0 (compatible)';
        ContentType := 'application/x-www-form-urlencoded';
        BasicAuthentication := True;
        UserName := 'hello';
        Password := 'world';


      end;

      xRequestBody := TStringList.Create;
      try
        xRequestBody.Add('grant_type=' + 'client_credentials');

        try
          memo1.Text := objHTTP.Post('https://something', xRequestBody);
        except
          on E: Exception do
            ShowMessage('Error on request: ' + #13#10 + e.Message);
        end;
      finally
        xRequestBody.Free;
      end;
    end;
     


  3. Is anyone able to help ?

    I'm trying to call an API with this code snippet below, but I got  error:1408F10B:SSL3_GET_RECORD:wrong version number

    I'm using INDY version 10.6.2.5298 with delphi seattle. Also downloaded libeay32.dll and ssleay32.dll (I forgot which version) and put in same folder with the exe.

     

    procedure TForm1.Button1Click(Sender: TObject);
    var
      xRequestBody: TStringList;
    begin
      IdOpenSSLSetLibPath(ExtractFilePath(ParamStr(0)));

      IdSSLIOHandlerSocketOpenSSL1.sslOptions.VerifyMode := [];
      IdSSLIOHandlerSocketOpenSSL1.sslOptions.VerifyDepth := 0;

      IdSSLIOHandlerSocketOpenSSL1.sslOptions.Method := sslvSSLv3;
      IdSSLIOHandlerSocketOpenSSL1.sslOptions.SSLVersions := [sslvSSLv3];

      IdSSLIOHandlerSocketOpenSSL1.sslOptions.VerifyMode := [];
      IdSSLIOHandlerSocketOpenSSL1.sslOptions.VerifyDepth := 0;

      IdSSLIOHandlerSocketOpenSSL1.PassThrough := false;

      objHTTP.handleredirects := True;
      objHTTP.Request.UserAgent := 'Mozilla/3.0 (compatible)';


      with objHTTP.Request do
      begin
        Clear;
        ContentType := 'application/x-www-form-urlencoded';
        BasicAuthentication := True;
        UserName := 'test';
        Password := 'test';
      end;

      xRequestBody := TStringList.Create;
      try
        xRequestBody.Add('grant_type=' + 'client_credentials');

        try
          memo1.Text := objHTTP.Post('https://something', xRequestBody);
        except
          on E: Exception do
            ShowMessage('Error on request: ' + #13#10 + e.Message);
        end;
      finally
        xRequestBody.Free;
      end;
    end;
     

×