Feature #17452

Add support for download resume to attachments

Added by Amit Baswa over 3 years ago. Updated over 3 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Attachments
Target version:-
Resolution:

Description

Hi Redmine,

Issue: 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.

Scenario: 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).

Proposed Solution: Attachment download should support Resume to avoid waste of time in re-downloading file unnecessarily

Environment:
Redmine version 2.4.2.stable
Ruby version 2.0.0-p247 (2013-06-27) [x86_64-linux]
Rails version 3.2.16
Environment production
Database adapter Mysql2
SCM:
Subversion 1.6.11
Git 1.9.3
Filesystem
Redmine plugins:
redmine_auto_watch 1.0.0
redmine_issue_checklist 2.0.5
redmine_overdue_notification_task 0.3.0
redmine_work_time 0.2.14
sidebar_hide 0.0.7

Attached File: Proof of Resume not supported.

Regards,
Amit

Untitled.jpg - Proof of Resume not supported (248 KB) Amit Baswa, 2014-07-12 09:08


Related issues

Related to Redmine - Defect #17403: Unknown file size while downloading attachment Closed

History

#1 Updated by Daniel Felix over 3 years ago

Hi there,

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.

Best regards,
Daniel

#2 Updated by Daniel Felix over 3 years ago

Just tested it on my environment. It worked for me on my server, but it is proper configured.

#3 Updated by Amit Baswa over 3 years ago

Thanks Daniel,

I'll apply necessary changes instructed by you and let you know the results.

Regards,
Amit

#4 Updated by Jean-Philippe Lang over 3 years ago

  • Tracker changed from Defect to Feature
  • Subject changed from Attachment does not Supported Resume Download to Add support for download resume to attachments

#5 Updated by Toshi MARUYAMA over 3 years ago

  • Related to Defect #17403: Unknown file size while downloading attachment added

Also available in: Atom PDF