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 7968679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:06:54+00:00 2026-06-04T07:06:54+00:00

Consider the follow code that downloads a file from internet using Indy components: procedure

  • 0

Consider the follow code that downloads a file from internet using Indy components:

procedure TForm26.Button1Click(Sender: TObject);
var
  vFileStream : TStream;
begin
  DeleteFile('C:\test.exe');
  vFileStream := TFileStream.Create('C:\test.exe', fmCreate);
  IdHTTP1.Get('SomeUrl', vFileStream);
  vFileStream.Free;
end;

I am getting an Out Of memory exception. What is happening is that besides the fact that I am using TFileStream, the bytes that are being written to it do not go directly to the disk, instead, they stay in memory until get terminates.

The file I am trying to download is really, really big.

Does anyone knows how to download a big file without getting an out of memory exception?

Delphi 2010 and latest Indy 10 from Indy’s SVN.

EDIT

That is not a FileStream problem. It is a Indy problem. Indy is, somehow, caching the file in memory before it writes to the stream.

  • 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-04T07:06:55+00:00Added an answer on June 4, 2026 at 7:06 am

    TIdHTTP downloads the entire file into memory if the data is compressed, or if the data is HTML and the TIdHTTP.HTTPOptions property does not contain the hoNoParseMetaHTTPEquiv flag.

    Indy does not yet support streaming decompression for HTTP (it does for FTP, though), so TIdHTTP caches the entire compressed data in memory before it can then decompress it to the file.

    Parsing HTML is sometimes needed in cases where the HTML overrides HTTP header values with new values via HTML <meta> tags, most importantly the data’s Charset value, so TIdHTTP can decode the data using the correct charset when the data is being returned to user’s code as a String. Enabling the hoNoParseMetaHTTPEquiv flag disables that parsing, and thus any caching of HTML data (unless compression is also used, that is).

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

Sidebar

Related Questions

Follow up question from What is a "rooted reference"? consider this code, for a
Consider the follow code: TMyList = class(TList<IMyItem>, IMyList) Delphi shows me the error: [DCC
Consider the following code (for simplicity, I did not follow any C# coding rules).
This is a follow-up questions on a previous one . Consider this code, which
Please consider the following code: type TFoo1 = class public procedure DoSomething1; end; TFoo2
Consider the following code snippet that takes user input (a date) and format it
Consider some code that can throw a checked exception (an exception of type Exception
Consider the following code (it's a little long, but hopefully you can follow): class
Tidying up some code that has what I consider to be a confusing line
This is a follow-up question to this one . Consider this example: #include <iostream>

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.