Search code examples
iosiphonedownloadepubmobile-browser

What could be causing epub, mobi and zip files to fail to download on an iPhone running ios 13?


I am having problems on my local server when trying to serve files to an iPhone running ios13. The problems only occur with file types that cannot be rendered in the browser, by that I mean files such as epub, mobi and zip that require me to manually click on download.

Manually download file in iOS

Files such as text and pdf have no issue in any browser.

Safari is able to download Mobi, Epub and Zip files, but Chrome, Firefox and Edge all fail giving vague messages like “Couldn’t Download” or “Download Failed”. Try Again.

Failed mobi download on iPhone in Chrome Mobile Browser

Originally I was serving the files using Nginx, X-Accel-Redirect and PHP, but I found that using a direct url had the same problem. The server is running HTTPS and HTTP2. Mime types are properly configured in Nginx.

In each case, regardless of whether the file was successfully downloaded or not, the access logs showed status code 200.

My questions are:

  1. What could be causing the failed downloads and how can I fix it?
  2. What other things should I investigate to shed more light on this issue?

Solution

  • It seems that the SSL certificate on the local server was causing the download issues. It was a self signed certificate and it often causes warnings to be displayed in the browser.

    I uploaded the epub/mobi/zip files to a server that didn’t use HTTPS and found that mobi, epub and zip files successfully downloaded regardless of the mobile browser used.

    I did the same with another server using a properly signed HTTPS certificate (letsencrypt) and again found that the mobi, epub and zip files successfully downloaded regardless of the mobile browser used.