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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:12:42+00:00 2026-06-03T19:12:42+00:00

I am trying to download a source code file from a web site which

  • 0

I am trying to download a source code file from a web site which works fine for small files, but a couple of larger ones get truncated.

The example below should be returning a file 146,135 bytes in size, but returns one of 141,194 bytes with a status of 200.

I have tried winhttp.winhttprequest.5.1 as well, but both seem to truncate at the same point.

I have also found quite a few people with similar problems, but have not been able to find a solution.

require('luacom')

http = luacom.CreateObject('MSXML2.ServerXMLHTTP')

http:Open("GET","http://www.family-historian.co.uk/wp-content/plugins/forced-download2/download.php?path=/wp-content/uploads/formidable/tatewise/&file=Map-Life-Facts3.fh_lua&id=190",true)
http:Send()
http:WaitForResponse(30)
print('Status: '..http.Status)
print('----------------------------------------------------------------')
headers = http:GetAllResponseHeaders()
data = http.Responsetext 
print('Data Size = '..#data)
print('----------------------------------------------------------------')
print(headers)
  • 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-03T19:12:44+00:00Added an answer on June 3, 2026 at 7:12 pm

    I finally worked out what was going on so will post it here for others.

    To avoid the truncation I needed to use ResponseBody and not ResponseText, what appears to be happening is the file is being sent in binary format, the ResponseText data is the same number of bytes as the ResponseBody one, but is in UTF-8 format, this means the number if special characters in the file (which are double byte in UTF-8 are dropped from the end of the ResponseText. I am not sure at what level the “mistake” in the length is made, but the way to avoid it is to use ResponseBody.

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

Sidebar

Related Questions

I have been trying to follow this example (download the source code from a
I can download ftp files from C# but it downloads the current date file.
I am trying to download Android source code for Contact,Dialer and CallLog applications from
I'm trying to download images (.jpg) from web folder using wget. I want to
I'm trying to download http://www.downway1.com/dota/eng/DotA%20Allstars%20v6.67.w3x this file. But it's not able to download. It's
I'm trying to download an html file with curl in bash. Like this site:
I'm trying to download a website source code and display it in a textbox
Im trying to download the source code of original Android Alarm Clock via git
I am trying download zip file to SD card. I download it correctly, but
I'm trying to use OpenURI to download a file from S3, and then save

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.