Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
in Q2A Core by

Hi Scott (and Gideon?),

when a PDf is uploaded as Blob and downloaded later on, the current qa-blob.php serves the file only as attachment. This always triggers the download dialog.

The embed plugin with PDF embed cannot work out of the box. The following core hack is necessary:

See from lline 75:

        $filename=preg_replace('/[^A-Za-z0-9 \\._-]/', '-', $blob['filename']); // for compatibility with HTTP headers and all browsers
        // q2apro hack for embed pdf
        if($blob['format']=='pdf') {
            header('Content-Type: application/pdf');
            header('Content-Disposition: inline; filename="'.$filename.'"');                    

        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename="'.$filename.'"');

Can this be included (as an option?) in q2a v1.7?


Q2A version: 1.6.3

Please log in or register to answer this question.