Add support for download resume to attachments
When we download attachments from Redmine issues, the resume is not supported to this download. It will be fine for low size attachments, but we do have attachments more than 100MB.
While downloading file (> 100MB), sometime it is possible that internet connection loss and after a while it comes back. At this time we are unable to Resume redmine attachment download and we have to start from Zero(0).
: Attachment download should support Resume to avoid waste of time in re-downloading file unnecessarily
Redmine version 2.4.2.stable
Ruby version 2.0.0-p247 (2013-06-27) [x86_64-linux]
Rails version 3.2.16
Database adapter Mysql2
Proof of Resume not supported.
#1 Updated by Daniel Felix over 3 years ago
this should be done by adding a new header and some client side server configuration..
This releates to change in #17403-5
Adding this line at the same position(source:trunk/app/controllers/attachments_controller.rb#L57):
headers['Accept-Ranges'] = "bytes"
Also replace the send_file command with this one:
send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
:type => detect_content_type(@attachment),
:disposition => (@attachment.image? ? 'inline' : 'attachment'),
:x_sendfile => true
Please mark the :x_sendfile => true setting at the end.
This is the rails part. On the otherhand your NGINX or Apache-Server needs to know how to handle streamed files. On an Apache you need the mod_xsendfile enabled.
Hope this helps. Feedback would be appreciated. This is untested and just pasted out of the memory. Please test this first in a development environment.