Refactor PDF extraction to use chunked upload to bypass proxy size limits
Build and Deploy / build-and-push (push) Successful in 30s

This commit is contained in:
AI Bot
2026-09-02 16:39:36 +05:30
parent 7a45b7a262
commit e941be0242
4 changed files with 302 additions and 11 deletions
+5 -3
View File
@@ -199,15 +199,17 @@ export const api = {
// ==========================================
extractPDF: async (file: File) => {
const formData = new FormData();
formData.append('file', file);
// 1. First upload the file using the chunked uploader to bypass proxy size limits
const fileUrl = await api.uploadAsset(file);
// 2. Then ask the backend to extract text from the now-local file
const res = await fetch(`${API_URL}/sparkplug/extract`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${localStorage.getItem('auth_token')}`
},
body: formData
body: JSON.stringify({ fileUrl })
});
const data = await res.json();
if (!res.ok) throw new Error(data.error);