1

Links on my Rails website to mp3-files can not be partially downloaded. But images can. How is this possible?

curl  --header "Range: bytes=30-50" http://app-staging.mydailylifestyle.com/images/mdl/nl/logo.png?1453478061  -o part1

returns a file of 21 bytes

curl  --header "Range: bytes=30-50" http://app-staging.mydailylifestyle.com/nl/audio/148.mp3?a=1  -o part1

returns a complete file however (more than 1000 bytes)

Also byte-range-requests work perfectly on normal stylesheets, but not on rails-generated stylesheets.

The audio controller uses x_sendfile:

def show
  @document = Document.find(params[:id])
  send_file(@document.audio_file(params[:format]),
          :type => Mime::Type.lookup_by_extension(params[:format]),
            :x_sendfile => use_x_sendfile?)
end

How is this possible?

Apache-setting XSendFilePath refers to the Rails root.

dirkjan
  • 11
  • 2

0 Answers0