Programmatic Upload
Add files and trigger uploads programmatically via the JavaScript API, without user interaction with the browse button.
What you should see: no visible controls at all — everything is triggered from code. Auto-upload is off so the start call is explicit.
Drag & drop files here, or paste from clipboard
<core-upload id="programmaticUploader"
asp-upload-url="/api/upload/upload"
asp-multiple="true"
asp-progress="true"
asp-auto-upload="false">
</core-upload>
<button id="btn-start-upload">Start Upload</button>
<script>
var uploader = CoreUpload.getInstance('#programmaticUploader');
document.getElementById('btn-start-upload')
.addEventListener('click', function() {
uploader.upload();
});
</script> Driving it from JavaScript
The rendered component exposes the same API the JavaScript library does, so your page can call upload(), cancel(), pause() and addFile() directly. The tag helper decides the initial configuration; it does not take control away.
Turn auto-upload off first
asp-auto-upload is true by default, so files start moving before your code decides anything. Programmatic control almost always wants it false, so that upload() is genuinely what starts the queue.