Salesforce Decode
Salesforcedecode
Back to questions
LWCIntermediatefilesupload

Build LWC file upload with lightning-file-upload

Real World Scenario

Case attachment upload must enforce 10MB limit and virus scan trigger.

Expected Answer

• lightning-file-upload record-id linked uploads • accept attribute restricting file types • Client size check before upload • onuploadfinished handler triggering Apex scan queue • Error toast on upload failure with retry • Guest user upload permission verification

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Direct answer: lightning-file-upload record-id linked uploads Also consider: accept attribute restricting file types In practice: Client size check before upload Balance speed of delivery with maintainability.

Architect Perspective

File upload is async—handle finished event not assume immediate availability.