From a6e22adf2e07407b4144587dbda0f0f492c3530d Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Wed, 29 Apr 2026 18:00:47 +0300 Subject: [PATCH] fix preview --- app/controllers/preview_document_page_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/preview_document_page_controller.rb b/app/controllers/preview_document_page_controller.rb index d0b69f8d..2befe3bf 100644 --- a/app/controllers/preview_document_page_controller.rb +++ b/app/controllers/preview_document_page_controller.rb @@ -41,7 +41,7 @@ class PreviewDocumentPageController < ActionController::API end def find_or_create_document_tempfile_path(attachment) - file_path = "#{Dir.tmpdir}/#{attachment.uuid}" + file_path = "#{Dir.tmpdir}/attachment-#{Digest::SHA1.hexdigest("#{attachment.id}-#{attachment.uuid}")}" File.open(file_path, File::RDWR | File::CREAT, 0o644) do |f| f.flock(File::LOCK_EX)