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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:23:31+00:00 2026-05-23T01:23:31+00:00

Question about this helper http://codeigniter.com/user_guide/helpers/download_helper.html If, for example, program.exe weights 4 GB, will it

  • 0

Question about this helper http://codeigniter.com/user_guide/helpers/download_helper.html

If, for example, program.exe weights 4 GB, will it take a lot of PHP memory for reading and delivering that file?

$data = file_get_contents("/path/to/program.exe"); // Read the file's contents
$name = 'software.exe';

force_download($name, $data);
  • 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-05-23T01:23:32+00:00Added an answer on May 23, 2026 at 1:23 am

    force_download function just set the proper HTTP headers to make the client’s browser download the file. So, it won’t open the file, just pass it’s URL to the client.

    Check the helper source code, if you need: https://bitbucket.org/ellislab/codeigniter-reactor/src/31b5c1dcf2ed/system/helpers/download_helper.php

    Edit: I’d sugest creating your own version of the helper, and, instead of using strlen to get the file size, use the php function filesize, which takes only the file name as argument and returns the size in bytes.

    More info, at http://www.php.net/manual/en/function.filesize.php

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

Sidebar

Related Questions

I asked a similar question about this previously, but I did not specify that
I have a question about this question . I posted a reply there but
I know there is already a question about this but my issue is more
I know about this question: Which (third-party) debug visualizers for Visual Studio 2005/2008 do
While thinking about this question and conversing with the participants, the idea came up
I was reading this question about how to parse URLs out of web pages
I just came across this question about initializing local variables. Many of the answers
As kind of a follow up to this question about prefixes , I agree
Surprisingly I was only able to find one previous question on SO about this
First, yes I know about this question , but I'm looking for a bit

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.