A
A
Alexander2017-01-19 19:20:05
Yii
Alexander, 2017-01-19 19:20:05

How to transfer a pdf file from a request to the browser's built-in adobe reader?

What to write in the view so that, upon request for a file, it is not saved on the PC, but opened in a new browser window using adobe reader or whatever it can do ... there is a
path to the file with the extension, and then the fog
$filename = Yii::getAlias ('@app').'/web/'.$file;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2017-01-19
@koshalex

use the sendFile method of the Response object

Yii::$app->response->sendFile ( $filename, 'File in browser', ['inline' => true]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question