Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7848851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:21:04+00:00 2026-06-02T18:21:04+00:00

I have a delphi code that basically upload files to remote secure server using

  • 0

I have a delphi code that basically upload files to remote secure server using Indy 10.4.704:

 IdHTTP                 := TIdHTTP.Create(nil);
 try
    TheCompressor       := TIdCompressorZLib.Create(nil);
    TheSSL              := TIdSSLIOHandlerSocketOpenSSL.Create(nil);

    with IdHTTP do
    begin
         HTTPOptions     := [hoForceEncodeParams];
         AllowCookies    := True;
         HandleRedirects := True;
         ProtocolVersion := pv1_1;

         IOHandler       := TheSSL;
         Compressor      := TheCompressor;
    end;    // with

    // Get upload resume offset
    try
       IdHttp.Head('https://www.domain.com/my-file.bin');
       if (IdHttp.Response.ResponseCode <> 404) And (IdHttp.Response.ContentLength >= 0) then
          StartPos   := IdHttp.Response.ContentLength
       else
           StartPos  := 0;
    except
          StartPos   := 0;
    end;    // try/except

    // Upload File
    TheFile          := TFileStream.Create(FileName, fmOpenRead OR fmShareDenyWrite);
    RangeStream      := TIdHTTPRangeStream.Create(TheFile, StartPos, -1, True);
    try
       if (RangeStream.ResponseCode = 206) then
          IdHTTP.Post(https://www.domain.com/upload.php', RangeStream);
    finally
           RangeStream.Free;
    end;    // try/finally
 finally
        FreeAndNil(IdHTTP);
 end;    // try/finally

The problem is that sometimes the code fails with Indy throwing a EIdSocketError Socket Error # 0 exception (idHTTP.ResponseCode is -1)

Given my crappy internet connection, I launched an EC2 windows instance and tested my code on it (the windows instance is running on the cloud, so I assume connection is not a problem), yet I got the same issue!

The error seems to be random, sometimes upload works, sometimes not. I debugged with TidLogFile, all I could find is something like this:

Stat Connected.
Sent 4/26/2012 4:18:42: POST /app/upload.php...
Sent 4/26/2012 4:18:42: <uploaded_file_data_here>
Stat Disconnected.

Anyone knows what’s causing this/how to fix this?

EDIT

I traced the exception back to TIdSSLIOHandlerSocketOpenSSL. I googled a lot, it seems that it’s not an SSL error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:21:08+00:00Added an answer on June 2, 2026 at 6:21 pm

    Please upgrade to the latest Indy 10 version, which is 10.5.8 r4743. SSL-related issues with Error Code 0 were fixed over a year ago.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this horribly stripped delphi code that basically login to server, save cookie
I have this delphi code that basically download a file (using Delphi 2010 +
I have a pascal code that encrypts files using RIJNDAEL / sha 512 and
I have some code that does custom drawing. Basically it is form fill program
I have Delphi 2007 code that looks like this: procedure WriteString(Stream: TFileStream; var SourceBuffer:
In some legacy Delphi code that I need to port to C#, I have
We have some legacy code that compiles in Delphi 6. There are plans to
I have Windows Server 2008 R2 Machine that is running a Delphi 2007 application.
I am using Delphi to code a simple app that needs to accept dropped
Are there any utilities that reformat Delphi code ? EDIT I am using Delphi

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.