File Extension Validation
Restrict uploads to specific file types using the asp-extensions attribute. Files that do not match the allowed extensions are rejected immediately on the client side before any upload begins.
What you should see: only
.jpg/.png/.gif/.webp are accepted, up to 5 MB. Choose a .pdf and it is refused immediately, before any request is made.Images Only (.jpg, .png, .gif, .webp)
Drag & drop files here, or paste from clipboard
Documents Only (.pdf, .doc, .docx, .xls, .xlsx)
Drag & drop files here, or paste from clipboard
<!-- Images only -->
<core-upload asp-upload-url="/api/upload/upload"
asp-extensions=".jpg,.png,.gif,.webp"
asp-max-size="5MB"
asp-button-text="Select Images">
</core-upload>
<!-- Documents only -->
<core-upload asp-upload-url="/api/upload/upload"
asp-extensions=".pdf,.doc,.docx,.xls,.xlsx"
asp-max-size="20MB"
asp-button-text="Select Documents">
</core-upload>