added 30+ supported file formats
This commit is contained in:
parent
1c4e5320e5
commit
c70dc59bfc
3 changed files with 50 additions and 13 deletions
22
README.md
22
README.md
|
|
@ -137,7 +137,12 @@ npm run dev
|
|||
- ✅ **Multi-Notebook Management** - Organize documents into collections
|
||||
- ✅ **6 AI Models** - GPT-5, Claude 4.5, Gemini 2.5 Pro, GPT-4o, Gemini Flash, GPT-4
|
||||
- ✅ **Pricing Display** - See costs for each model
|
||||
- ✅ **Multi-Document Upload** - Upload 1-20 PDFs per notebook
|
||||
- ✅ **Multi-Document Upload** - Upload 1-20 files per notebook
|
||||
- Documents: PDF, Word, PowerPoint, RTF, EPUB, Pages, Keynote, TXT, MD
|
||||
- Spreadsheets: Excel, CSV, TSV, Numbers
|
||||
- Images: JPG, PNG, GIF, BMP, TIFF, SVG (with OCR)
|
||||
- Audio: MP3, WAV, M4A (transcription, 20MB limit)
|
||||
- Web: HTML
|
||||
- ✅ **Background Processing** - Non-blocking document analysis
|
||||
- ✅ **Real-time Status** - Watch processing progress
|
||||
|
||||
|
|
@ -311,11 +316,16 @@ UPDATE users SET is_admin = true WHERE email = 'your@email.com';
|
|||
|
||||
**Upload Documents:**
|
||||
1. Open your notebook
|
||||
2. Click "Select PDF Files"
|
||||
3. Choose 1-20 PDFs
|
||||
2. Click "Select Files"
|
||||
3. Choose 1-20 files (supports 30+ formats):
|
||||
- Documents: PDF, DOCX, PPTX, RTF, EPUB, TXT, MD, and more
|
||||
- Spreadsheets: XLSX, CSV, TSV
|
||||
- Images: JPG, PNG (with OCR)
|
||||
- Audio: MP3, WAV (with transcription, 20MB limit)
|
||||
- Web: HTML
|
||||
4. Click "Upload X File(s)"
|
||||
5. Wait ~1 minute per document for processing
|
||||
6. Expand documents to see summaries, highlights, Q&A
|
||||
5. Wait ~1 minute per file for processing
|
||||
6. Expand files to see summaries, highlights, Q&A
|
||||
|
||||
**Generate Cross-Document Analysis:**
|
||||
1. Click "Cross-Doc Analysis" button
|
||||
|
|
@ -562,7 +572,7 @@ curl -X PUT "http://localhost:9000/api/admin/users/USER_ID/role?is_admin=true&re
|
|||
- **Role-Based Access:** Admin-only pages
|
||||
- **CORS:** Configured for localhost:4000
|
||||
- **SQL Injection Protection:** SQLAlchemy ORM
|
||||
- **File Validation:** PDF-only uploads
|
||||
- **File Validation:** 30+ file types supported (documents, spreadsheets, images, audio, web)
|
||||
- **Permission System:** Granular notebook sharing
|
||||
|
||||
---
|
||||
|
|
|
|||
|
|
@ -52,10 +52,22 @@ async def upload_document(
|
|||
if not notebook:
|
||||
raise HTTPException(status_code=404, detail="Notebook not found")
|
||||
|
||||
# Validate file type
|
||||
supported_extensions = ('.pdf', '.docx', '.doc', '.pptx', '.ppt', '.txt', '.md')
|
||||
# Validate file type - LlamaParse supports all these formats
|
||||
supported_extensions = (
|
||||
# Documents
|
||||
'.pdf', '.docx', '.doc', '.pptx', '.ppt', '.txt', '.md', '.rtf', '.epub',
|
||||
'.pages', '.key', '.odt', '.odp',
|
||||
# Spreadsheets
|
||||
'.xlsx', '.xls', '.xlsm', '.xlsb', '.csv', '.tsv', '.numbers', '.ods',
|
||||
# Images (OCR)
|
||||
'.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.webp', '.svg',
|
||||
# Web
|
||||
'.html', '.htm',
|
||||
# Audio (transcription, 20MB limit)
|
||||
'.mp3', '.mp4', '.mpeg', '.m4a', '.wav', '.webm'
|
||||
)
|
||||
if not file.filename.lower().endswith(supported_extensions):
|
||||
raise HTTPException(status_code=400, detail="Supported file types: PDF, DOCX, DOC, PPTX, PPT, TXT, MD")
|
||||
raise HTTPException(status_code=400, detail="Unsupported file type. See upload page for supported formats.")
|
||||
|
||||
try:
|
||||
# Save to temporary file
|
||||
|
|
|
|||
|
|
@ -167,14 +167,26 @@ export default function NotebookDetailPage() {
|
|||
const files = e.target.files;
|
||||
if (!files) return;
|
||||
|
||||
const supportedExtensions = ['.pdf', '.docx', '.doc', '.pptx', '.ppt', '.txt', '.md'];
|
||||
const supportedExtensions = [
|
||||
// Documents
|
||||
'.pdf', '.docx', '.doc', '.pptx', '.ppt', '.txt', '.md', '.rtf', '.epub',
|
||||
'.pages', '.key', '.odt', '.odp',
|
||||
// Spreadsheets
|
||||
'.xlsx', '.xls', '.xlsm', '.xlsb', '.csv', '.tsv', '.numbers', '.ods',
|
||||
// Images (OCR)
|
||||
'.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.webp', '.svg',
|
||||
// Web
|
||||
'.html', '.htm',
|
||||
// Audio (transcription)
|
||||
'.mp3', '.mp4', '.mpeg', '.m4a', '.wav', '.webm'
|
||||
];
|
||||
const validFiles = Array.from(files).filter(file => {
|
||||
const fileName = file.name.toLowerCase();
|
||||
return supportedExtensions.some(ext => fileName.endsWith(ext));
|
||||
});
|
||||
|
||||
if (validFiles.length !== files.length) {
|
||||
alert('Supported file types: PDF, DOCX, DOC, PPTX, PPT, TXT, MD');
|
||||
alert('Unsupported file type(s) detected.\n\nSupported formats:\n• Documents: PDF, DOCX, PPTX, RTF, EPUB, Pages, Keynote, TXT, MD\n• Spreadsheets: XLSX, XLS, CSV, TSV, Numbers\n• Images: JPG, PNG, GIF, BMP, TIFF, SVG (with OCR)\n• Web: HTML\n• Audio: MP3, WAV, M4A (transcription, 20MB limit)');
|
||||
}
|
||||
|
||||
if (validFiles.length > 20) {
|
||||
|
|
@ -537,13 +549,16 @@ export default function NotebookDetailPage() {
|
|||
<div className="border-2 border-dashed border-gray-300 rounded-lg p-8 hover:border-blue-400 transition">
|
||||
<Upload className="w-12 h-12 text-gray-700 mx-auto mb-4" />
|
||||
<p className="text-center text-gray-700 mb-4">
|
||||
Upload documents: PDF, DOCX, PPTX, TXT, MD (up to 20 files)
|
||||
Upload documents, spreadsheets, images, audio, or web pages (up to 20 files)
|
||||
</p>
|
||||
<p className="text-xs text-gray-700 text-center mb-4">
|
||||
Supports: PDF, Office (Word/Excel/PowerPoint), Images (JPG/PNG), Audio (MP3/WAV), CSV, HTML, and more
|
||||
</p>
|
||||
|
||||
<input
|
||||
ref={fileInputRef}
|
||||
type="file"
|
||||
accept=".pdf,.docx,.doc,.pptx,.ppt,.txt,.md"
|
||||
accept=".pdf,.docx,.doc,.pptx,.ppt,.xlsx,.xls,.xlsm,.xlsb,.csv,.tsv,.txt,.md,.rtf,.epub,.pages,.key,.odt,.odp,.numbers,.ods,.jpg,.jpeg,.png,.gif,.bmp,.tiff,.webp,.svg,.html,.htm,.mp3,.mp4,.mpeg,.m4a,.wav,.webm"
|
||||
multiple
|
||||
onChange={handleFilesSelect}
|
||||
className="hidden"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue