File Upload — Concept Check
Questions on File Upload. A file input cannot be controlled, uploads need progress that fetch cannot report, and at any real size the file should not pass through your API at all.
Questions in this quiz
7 questions on File Upload — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A user reports that their file upload progress bar does not update when uploading large files using the Fetch API. What is the likely issue?
- AThe progress bar is not properly linked to the upload event.
- BFetch API does not support upload progress events.
- CThe server is not sending progress updates.
- DThe file size exceeds the server's limit.
2.You are tasked with implementing a file upload feature. Why should you avoid routing large files through your backend server?
- AThe client cannot handle large files.
- BThe server cannot validate file types effectively.
- CIt increases server load and hits request size limits.
- DIt is not possible to track upload progress.
3.When implementing a file upload system, why is it important to validate file type and size on the client-side?
- ATo replace server-side validation.
- BTo prevent server overload.
- CTo provide immediate feedback to users.
- DTo ensure files are securely uploaded.
4.A developer notices memory issues after implementing file previews. What might they have overlooked?
- ARevoking object URLs after use.
- BSetting a file size limit.
- CUsing XMLHttpRequest for uploads.
- DUsing data URLs instead of object URLs.
5.What is the primary reason for using XMLHttpRequest over Fetch API for file uploads?
- AXMLHttpRequest supports upload progress events.
- BXMLHttpRequest is faster than Fetch API.
- CXMLHttpRequest has better error handling.
- DXMLHttpRequest is more secure than Fetch API.
6.A user tries to upload a 10MB image file, but receives an error message. What is a likely cause?
- AThe file exceeds the client-side size limit.
- BThe network connection is unstable.
- CThe server is down.
- DThe file type is not supported.
7.Why should the server generate a pre-signed URL for direct-to-storage uploads?
- ATo bypass client-side validation.
- BTo speed up the upload process.
- CTo authenticate the user and enforce content constraints.
- DTo allow the client to choose the storage path.