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 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 found out recently that JList (finally!) was generified in JDK7. Why JTree and
I am finally asking this question as I have never actually found an answer.
I have been reading about try/finally on MSDN and found out following code. They
I finally solved one problem but now i have another. I found out how
Ive been stuck on this all day and finally found a script which would
Finally found out how to make DbgPrint to really print in Win Vista/7 with:
I finally found out the difference between UTC and GMT by making the effort
I finally found the problem, but there is no way this is making sense,
I've been looking for a timepicker and finally found this one, timepicker , the
I have searched a lot about regex and finally I found out that it's

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.