Preeeeet commited on
Commit
21e4481
·
verified ·
1 Parent(s): 64494d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -15,7 +15,10 @@ class MultiDocMerger:
15
  def add_document(self, file):
16
  file_path = os.path.join(self.temp_dir, file.name)
17
  with open(file_path, 'wb') as f:
18
- f.write(file.read())
 
 
 
19
  self.documents.append(file_path)
20
  self._extract_pages(file_path)
21
  return self._generate_preview()
 
15
  def add_document(self, file):
16
  file_path = os.path.join(self.temp_dir, file.name)
17
  with open(file_path, 'wb') as f:
18
+ f.write(file.file.read()) # Use file.file.read() instead of file.read()
19
+ self.documents.append(file_path)
20
+ self._extract_pages(file_path)
21
+ return self._generate_preview()
22
  self.documents.append(file_path)
23
  self._extract_pages(file_path)
24
  return self._generate_preview()