Note that there are some explanatory texts on larger screens.

plurals
  1. POAPK download failure if behind password protected site on stock browser
    text
    copied!<p>I'm having an issue serving an APK on my server that is using rails. I can serve the APK if the download link is put in /public. However, I want to password protect it. If I move the file behind a URL that requires HTTP authentication, then it will fail on the stock browser with a <code>Download Unsuccessful</code> immediately.</p> <p>If I install and run firefox, firefox is able to download the APK and install correctly.</p> <p>Anyone know how to make this work with Android's stock browser?</p> <p>I have added the <code>MIME Type</code> to the server:</p> <pre><code>Mime::Type.register "application/vnd.android.package-archive", :apk </code></pre> <p>And I'm trying to send_file while behind HTTP authentication:</p> <pre><code>send_file "android.apk", :type =&gt; 'application/vnd.android.package-archive' </code></pre> <p>Successful HTTP-header from /public:</p> <pre><code>~ curl -s -D- android.apk -o/dev/null HTTP/1.1 200 OK Server: nginx/1.4.1 Date: Thu, 11 Jul 2013 20:06:43 GMT Content-Type: application/octet-stream Content-Length: 38673086 Last-Modified: Thu, 11 Jul 2013 20:05:12 GMT Connection: keep-alive ETag: "51df0ff8-24e1abe" Accept-Ranges: bytes </code></pre> <p>Unsuccessful HTTP header from behind HTTP Authentication:</p> <pre><code>~ curl -s -D- private/android.apk -o/dev/null HTTP/1.1 200 OK Server: nginx/1.4.1 Date: Thu, 11 Jul 2013 20:11:53 GMT Content-Type: application/octet-stream Transfer-Encoding: chunked Connection: keep-alive Status: 200 OK X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff X-UA-Compatible: chrome=1 Content-Disposition: attachment; filename="SironaVideoSurvey.apk" Content-Transfer-Encoding: binary Cache-Control: private Set-Cookie: request_method=GET; path=/ X-Request-Id: 6b99f5e5-87f8-4f8c-816c-0034265b3991 X-Runtime: 0.016140 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload