Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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()
|