To add, I had “Open in Browser” setting enabled when I receive this error.
After I uncheck it, it downloads the PDF file but I want the end-user to be able to view it prior to downloading.
I tested this on android smartphone and tablet using both Chrome and Firefox, Android 5.0 and 5.1.1 (Lollipop)
It worked fine on Apple OS.