EN · DE · RU · FR · ES

#2607: SingleFileUploadWithProgress.tsx

projectforge-webapp/src/components/base/dynamicLayout/components/upload/SingleFileUploadWithProgress.tsx TypeScript React Component (XHR Upload with Progress Bar), projectforge-webapp/src/components/base/dynamicLayout/components/upload/SingleFileUploadWithProgress.tsx 92 lines · 76 code · 4 comments · 12 blank
Uploads a single file via XMLHttpRequest POST with FormData (fields: file, upload_preset). Tracks upload percentage via xhr.upload.onprogress — updates useState(0) progress. Renders FileHeader + reactstrap Progress bar: yellow "warning" / animated while uploading, green "success" / static at 100%. Triggers onUpload callback on mount via useEffect and afterFileUpload via xhr.onreadystatechange. Based on bmvantunes' Formik tutorial.

Git History

033629f77 fix typescript eslint bugs
da657e1ce WIP: multi upload
d818f1a28 WIP: multi upload
f71abe9aa WIP: multi upload
87c1212c2 WIP: multi upload