Project

General

Profile

Actions

Feature #17452

open

Add support for download resume to attachments

Added by Amit Baswa over 9 years ago. Updated about 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
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


Files

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

Related issues

Related to Redmine - Defect #17403: Unknown file size while downloading attachmentClosedJean-Philippe Lang

Actions
Actions #1

Updated by Daniel Felix over 9 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

Actions #2

Updated by Daniel Felix over 9 years ago

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

Actions #3

Updated by Amit Baswa over 9 years ago

Thanks Daniel,

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

Regards,
Amit

Actions #4

Updated by Jean-Philippe Lang over 9 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
Actions #5

Updated by Toshi MARUYAMA over 9 years ago

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

Updated by Meiki Neumann about 4 years ago

Nothing yet ?!
I did all of the Daniel Felix' instructions and my NGINX configuration is OK with another service ( Supports resume) but not on redmine files

Actions

Also available in: Atom PDF