1

I have put a binary file (.apk) on redmine/public folder but when I try to download that file I only get the text version of that file as text.

How to change that behavior to direct download?

Ivan Cachicatari
  • 4,212
  • 2
  • 21
  • 41

1 Answers1

0

You need to navigate to the httputils.rb file (it's wherever webrick is installed) and add this line to the list of MIME types:

application/vnd.android.package-archive     apk

If that seems like a lot of trouble and you're not trying to do anything fancy with this download (e.g. download it directly from an android phone and install it), you can always wrap it in a .zip and call it a day. Zip files will download automatically.

eiko
  • 5,110
  • 6
  • 17
  • 35
  • There is no httputils.rb file in redmine source code – Ivan Cachicatari Apr 08 '17 at 09:01
  • @IvanCachicatari are you sure you're using webrick to power redmine then? if you're using webrick, there's an httputils.rb *somewhere*. – eiko Apr 09 '17 at 04:46
  • I found that file, but still doesn't work... when I try to load the apk: `curl -s -D - http://localhost:3000/app.apk -o /dev/null` I got `Content-Type: text/html` – Ivan Cachicatari Apr 09 '17 at 16:53