Skip to content

Commit

Permalink
fix: create tmp folder to store docs as 0700
Browse files Browse the repository at this point in the history
Signed-off-by: Anupam Kumar <[email protected]>
  • Loading branch information
kyteinsky committed Apr 15, 2024
1 parent 60f2a5d commit dc3579c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Service/AssistantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public function parseTextFromFile(string $filePath, string $userId): string {
$tempFilePath = sys_get_temp_dir() . '/assistant_app/' . uniqid() . '.tmp';
// Make sure the temp dir exists
if (!file_exists(dirname($tempFilePath))) {
mkdir(dirname($tempFilePath), 0600, true);
mkdir(dirname($tempFilePath), 0700, true);
}
file_put_contents($tempFilePath, $contents);

Expand Down Expand Up @@ -494,7 +494,6 @@ private function parseDocument(string $filePath, string $mimeType): string {
foreach ($sections as $section) {
$elements = $section->getElements();
foreach ($elements as $element) {
$class = get_class($element);
if (method_exists($element, 'getText')) {
$outText .= $element->getText() . "\n";
}
Expand Down

0 comments on commit dc3579c

Please sign in to comment.