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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:36:20+00:00 2026-05-13T09:36:20+00:00

I am programming a software in Python to download HTTP PDF from a database.

  • 0

I am programming a software in Python to download HTTP PDF from a database.
Sometimes the download stop with this message :

retrieval incomplete: got only 3617232 out of 10689634 bytes

How can I ask the download to restart where it stops using the 206 Partial Content HTTP feature ?

I can do it using wget -c and it works pretty well, but I would like to implement it directly in my Python software.

Any idea ?

Thank you

  • 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-13T09:36:20+00:00Added an answer on May 13, 2026 at 9:36 am

    You can request a partial download by sending a GET with the Range header:

    import urllib2
    req = urllib2.Request('http://www.python.org/')
    #
    # Here we request that bytes 18000--19000 be downloaded.
    # The range is inclusive, and starts at 0.
    #
    req.headers['Range'] = 'bytes=%s-%s' % (18000, 19000)
    f = urllib2.urlopen(req)
    # This shows you the *actual* bytes that have been downloaded.
    range=f.headers.get('Content-Range')
    print(range)
    # bytes 18000-18030/18031
    print(repr(f.read()))
    # '  </div>\n</body>\n</html>\n\n\n\n\n\n\n'
    

    Be careful to check the Content-Range to learn what bytes have actually been downloaded, since your range may be out of bounds, and/or not all servers seem to respect the Range header.

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

Sidebar

Related Questions

This is not programming related as much as it is software engineering related. I
Is there any difference downloading the pdt from eclipse install software/Programming languages/pdt versus the
Note: This question IS programming related! It's all about better code and better software
I've already made a simple software with Python programming language. It has some libraries
I'm programming a software using .NET FRAMEWORK 4.5 in METRO APPLICATIONS. I'm using the
I am building programming contest software. A user's program is received by our judging
Can software be written (for some specific programming language, platform, etc.) that will inform
What I was taught at school is all about programming languages, software design, but
The software tool SWIG can be used to create a programming interface (bindings) to
ORIGINAL MESSAGE (now outdated): After running python setup.py install I get the following: Warning:

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.