Hello!
I have a problem. I use local storage to original files to optimize open document timing. It’s work successful. And I need to convert PPTX files to PDF as intermediate form before sliding as PDF files per page. Files will be available at GET http://web/files/open?id=1&token=. i check access with use
sudo docker exec onlyoffice curl -o /tmp/file.pptx "http://web/files/open?id=1&token=<token>"
command and it is dowloaded success.
I use this script for this purpose:
/** @param LocalStorage $s Class what get a link like 'http://web/files/open?id=<id>&token=<bearer token>' for access to open file. It's used in OnlyOffice Editor
* @param string $bucket It's root directory.
* @param string $s3_key Rest of file path
*/
public static function convertToPdf(LocalStorage $s, $bucket, $s3_key) {
$url = $s->generatePresignedUrl('GetObject', $bucket, $s3_key, "+20 minutes");
$payload = [
"async" => false,
"filetype" => pathinfo($s3_key, PATHINFO_EXTENSION),
"outputtype" => "pdf",
"url" => $url,
"key" => Yii::$app->security->generateRandomString(20),
];
$client = new Client();
$response = $client->post(self::DOC_SERV_CONVERTER_URL, json_encode($payload), ['accept' => 'application/json'])->send();
if ($response->isOk && !isset($response->data['error']))
return $response->data['fileUrl'];
throw new ServerErrorHttpException("Не удалось конвертировать файл: " . $response->data['error']);
}
But I take error -4 at any time. What is description of this error? I think, what it can be extension-less file name is reason. Can it be another reason?
Server configuration:
DocumentBuilder version: 7.0.1.37
Docker containers: web (Nginx), php, onlyoffice.
OS: Debian Linux
Thanks for answer,
Dmitry