Я пытаюсь защитить паролем файл Excel
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$spreadsheet = new Spreadsheet();
$activeWorksheet = $spreadsheet->getActiveSheet();
$activeWorksheet->setCellValue('A1', 'Hello World !');
$spreadsheet->getSecurity()->setLockWindows(true);
$spreadsheet->getSecurity()->setLockStructure(true);
$spreadsheet->getSecurity()->setWorkbookPassword("123456");
Код выше не защищает файл
Я использовал метод шифрования
use Nick\SecureSpreadsheet\Encrypt;
$test = new Encrypt($nofile = true);
$output = $test->input($binaryData)
->password('111')
->output();
Как получить двоичные данные из выходных данных phpspreadsheet?
$writer = new Xlsx($spreadsheet);
$fileName = 'staff_data.xlsx';
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment; filename="'. urlencode($fileName).'"');
$writer->save('php://output');
Подробнее здесь: https://stackoverflow.com/questions/784 ... nrypt-file
Файл PHPSpreadsheet, защищенный паролем или зашифрованный ⇐ Php
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как извлечь зашифрованный ключ и зашифрованный контент из объекта CMS EnvelopedData в Java?
Anonymous » » в форуме JAVA - 0 Ответы
- 23 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как извлечь зашифрованный ключ и зашифрованный контент из объекта CMS EnvelopedData в Java?
Anonymous » » в форуме JAVA - 0 Ответы
- 28 Просмотры
-
Последнее сообщение Anonymous
-