New-UDUpload doesn't seem to run anything in the OnUpload block

Been trying to get New-UDUpload to work. It gives the file selection window, progress bar then displays the file that was uploaded under the button but that’s it. It doesn’t seem like it runs what is in the OnUpload block no matter what is put in there. There isn’t anything in the logs I could find. I tried intentionally putting some invalid stuff in there to cause it to generate some errors to see if it was even running that and it was not in the logs either. Is anyone else having this issue?

Product: PowerShell Universal
Version: 3.1.4

I just tried this and was able to upload stuff.

New-UDDashboard -Content {
    New-UDUpload -Text 'Upload' -OnUpload {
        Show-UDToast ($EventData.FileName)
    }
}

Can you press F12 in your browser to see if there are HTTP errors?

Please update the following components: UDElementContent, UdElement
printWarning @ react-dom.development.js:67
upload.jsx:71 Content-Range bytes 0-39/40
/api/internal/component/element/5c420757-1c00-4957-8b23-5ff29217619a:1 Failed to load resource: the server responded with a status of 500 ()
fetch-service.jsx:241 Error
at fetch-service.jsx:236:23

Are you uploading a large file or does this happen with any file?

Any file.

It’s something in my appsettings.json file. I shut the service down, moved the file and restarted the service to see if just using the default configuration worked and it did. I’ll have to track down what in the file is the cause.

After changing things in the appsettings.json file to try and track to down what is was, I found if I have SQL as the DB type uploading does not work. When I switch it to use the LiteDB DB then the uploads work.

Thanks for the info. I’ll open an issue for this. I was testing with litedb.