Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
437 views
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:

    default:
        $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.'"');                    
            break;
        }

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

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

Thanks,
Kai

Q2A version: 1.6.3

Please log in or register to answer this question.

...