I can’t work on a problem that I can’t diagnose. While you might be able to see the files when you route to them directly, I cannot see them on the links you’ve given me. Instead, Chrome presents a “Failed to load PDF document” error.
I pulled up the same URL in a web proxy tool to inspect the actual data you’re sending across. Your server is delivering a PDF, but the file itself is corrupt.
Inspecting the file directly, I can see it’s a PDF 1.4 document and I can see the file stream.
The download link for the file does work, though: https://tiefenoekologie.at/publication/download/interview-mit-andreas-schelakovsky-im-magazin-wienerin/
This tells me something is going wrong in how your server is streaming to the browser for viewing.
Both the view and download methods use PHP’s readfile()
function to stream the file contents to the browser. Since the download method is working but the view method isn’t, I looked at the actual output of both.
Both are streaming the entire file. The view method, however, is automatically appending some additional hex content to the end of the file for which I cannot account – since the plugin merely reads the file then calls exit()
, this means something on your server is appending the content.
There isn’t a fix in the plugin I can provide.
However, if you add the following code to your theme’s functions.php file, the plugin will skip the streaming entirely and merely redirect visitors the the file itself (since the file is working on your server, this is the best solution):
add_filter( 'wppa_mask_url', '__return_false' );