feat: allow application/octet-stream MIME type for PDF uploads in receipt import
This commit is contained in:
@@ -84,7 +84,10 @@ export class ReceiptImportService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isPdf = file.mimetype === 'application/pdf';
|
const isPdf =
|
||||||
|
file.mimetype === 'application/pdf' ||
|
||||||
|
file.mimetype === 'application/octet-stream' ||
|
||||||
|
file.originalname?.toLowerCase().endsWith('.pdf');
|
||||||
const rawItems = isPdf
|
const rawItems = isPdf
|
||||||
? await this.parseReceiptFromPdf(file.buffer, apiKey)
|
? await this.parseReceiptFromPdf(file.buffer, apiKey)
|
||||||
: await this.parseReceiptFromImage(file.buffer, file.mimetype, apiKey);
|
: await this.parseReceiptFromImage(file.buffer, file.mimetype, apiKey);
|
||||||
|
|||||||
Reference in New Issue
Block a user