プロジェクト

全般

プロフィール

Vote #66249

完了

Use mime types in downloading from repository

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
SCM_3
対象バージョン:
開始日:
2009/12/23
期日:
進捗率:

0%

予定工数:
category_id:
3
version_id:
27
issue_org_id:
4477
author_id:
3866
assigned_to_id:
0
comments:
5
status_id:
5
tracker_id:
2
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Ok, so appart from the @export:@ links in "wiki" fields looking ugly (are there plans to make them show either only the filename or even make the links "configurable" like http links?), I had a user asking if there was a way to make the pdfs he had in the repo be shown in the browser instead of force-downloading them.

I have whipped up a small patch (somewhat looked off of the "mimetype-fu":http://github.com/mattetti/mimetype-fu plugin) that guesses the mime-type of a file according to its extension and @Mime::Type@ and sets the disposition to inline to make browsers show them instead of downloading them. The patch is attached, but it changes the behavior of the "@raw@" download action also used by the download-Link in the repository tab.

That brings us to the discussion if the "@raw@" Links should be changed, or if an extra action, say @show@, should be configured, but the changes to the patch should be quite straightforward.

Last but not least: there are only a very few mime types defined in redmine at the moment, one source for some more could e.g. be "this list":http://github.com/mattetti/mimetype-fu/blob/aecc4c1dc4e4d1d582b7ac97808de18f13a756e7/lib/mime_types.yml from the mimetype-fu plugin.


journals

+1 for the concept (although I haven't tried out the attached patch).
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Original subject problem is similar with #6256.

This issue feature is implemented by r5210.
--------------------------------------------------------------------------------
AttachmentsController uses "inline" for only images.
See source:tags/1.1.2/app/controllers/attachments_controller.rb#L43.
--------------------------------------------------------------------------------


related_issues

relates,Closed,6256,Redmine considers non ASCII and UTF-16 text files as binary in SCM
relates,New,2209,MIME type support for repository Entries
duplicates,Closed,5055,Set mime-type in response when downloading repository files

Admin Redmine さんがほぼ2年前に更新

  • カテゴリSCM_3 にセット
  • 対象バージョン1.2.0_27 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0