What I’m trying to do:
My app offers users APKG files (basically zip files) for download. Suddenly downloads under iOS start but never finish (stuck at 0%, 96% or even 99%) when you simply click on the link. It looks like this from the user perspective:
4 people independently reported this same issue to me. It started appearing in the last few weeks. I haven’t changed my code during that time and everything works fine on PC (Brave, Edge) and Android (Brave).
Weirdly enough, it also works when I offer a PDF file instead of an APKG for download.
Under iOS it only works when you long press the link and then choose “Verknüpfte Datei laden” (= “load connected file”).
What I’ve tried and what’s not working:
Here is my code that I haven’t touched recently (simplified, but enough to reproduce the issue):
Code Sample:
@anvil.server.http_endpoint("/test_dl/:")
def test_dl(**params): #✔️
dl = app_tables.download_files.get(for_update=None)
if dl is not None:
r = anvil.server.HttpResponse()
r.headers['content-disposition'] = 'attachment; filename="test.apkg"'
r.headers['content-type'] = 'application/apkg'
r.body = dl['anki_file']
return r
return "Fail"
Here you can try the download for yourself.