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

  • Home
  • SEARCH
  • 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 802223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:34:02+00:00 2026-05-14T23:34:02+00:00

Finally found out how to achieve this! Turned out it is as simple as

  • 0

Finally found out how to achieve this!

Turned out it is as simple as enabling xsendfile and setting header parameter Accept-Range

Read my answer below

(by the way, in the block quote below I wrote a common pitfall newbies – like I did – made. We tend to think it should be manually programmed)

URL must be something like:
mysite.com/get_file?file_point=100 ->
this will read from byte 100

  1. Get the offset from parameter (file_point parameter in our example)
  2. Find out size of file (File.size)
  3. Read the file from offset to length (Equivalent of fseek in PHP)
  4. Send the file using send_file

I dont know how to do step #3 in Ruby
in the steps above.

  • 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-14T23:34:03+00:00Added an answer on May 14, 2026 at 11:34 pm

    This was how I did it:

    response.header["Accept-Ranges"] = "bytes"
    send_file product.pack.path, :type => product.pack_content_type, :x_sendfile=>true
    

    I asked our server guy to set up mod_xsendfile, I don’t know how to set it myself.

    Tutorial here: http://www.devsource.com/c/a/Techniques/Resumable-File-Downloads-with-ASPNet/2/

    Read about content-length here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13

    About streaming is available here: http://api.rubyonrails.org/classes/ActionController/Streaming.html

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

Sidebar

Related Questions

I finally found out the difference between UTC and GMT by making the effort
I finally have a hardware guy that is insterested in controlling the firmware. This
I finally got my group to switch from SourceSafe to Subversion. Unfortunately, my manager
I'm finally getting my team to embrace source code management now that we're working
I have finally finished my web site. I published it, and I was surprised
Since there is no finally in C++ you have to use the RAII design
Well the docs finally said it, I need to take it easy on my
I've finally completed a working version of my first ever CSS-supported site (thanks to
I have finally got the green light to use Memcached in our project (after
I've finally got the datepicker to work on my MVC demo site and also

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.