New-UDUpload is not working for .zip files

@adam

it will be good if we have these settings in the appsettings.json if possible also this component will be nice if it has the multi upload files feature rather than a single file.
but anyway any soon solution will be much appreciated

someone could make a new component :slight_smile: Uploading Large Files as Chunks Using ReactJS & .Net Core | by Mehmet Yener YILMAZ | The Startup | Medium

one could argu that this is the correct way :slight_smile:

1 Like

2 Likes

please check that the module is not locked:
Uploading Large Files to IIS / NET. Core / ASP.NET (webdavsystem.com)

@McAndersDK
based on your link this module limit is 2GB so i dont think this module has anything to do with ~30+ MB file size unless am missing something here.

1 Like

I’m also running into this file size limitation, any progress on adding configuration of these settings for those of us not hosting in IIS?

We’ve removed the server-side limit for this but I’m wondering if there is something we need to configure within the component itself. I think there is more work that may need to be done with this component to make it truly support large file uploads.

1 Like

just recently tested and still the same issue with 1.5.19

Just wondering if you’ve had an opportunity to get back to this, the size limitation seems to still exist on 2.1.2

I’ll knock the priority up on this. It hasn’t been resolved.

1 Like

Any update on this? I just tried again on 2.3.1 and still seem to have the same issue

Hey @adam - We upgraded to 2.4.1 last week hoping this issue would be resolved, but I think there is another bug in the upload method.

I noticed this issue in the github issues, New-UDUpload does not work properly in UDForm · Issue #628 · ironmansoftware/issues (github.com)
But I think it might be a bigger problem, at least for us. We had been testing the upload inside a UDForm, nested inside a tab in a dashboard. We just tried again in a new dashboard without tabs, or even the form and there isn’t any information being added to the body. The only way I seem to be able to get any information about the upload is referencing the ID of the upload like this:

New-UDDashboard -Title "Hello, World!" -Content {
    New-UDUpload -Id 'MyUpload' -Text 'Upload1' -OnUpload {
        Show-UDToast (Get-UDElement -Id 'MyUpload') -Duration 2500
    }
}

Am I missing something obvious?

I just tried this on 2.4.1 and it works:

New-UDDashboard -Title "Hello, World!" -Content {
    New-UDUpload -Id 'MyUpload' -Text 'Upload1' -OnUpload {
        Show-UDToast $Body.Data -Duration 2500
        Show-UDToast $Body.FIleName -Duration 2500
        Show-UDToast $Body.Name -Duration 2500
        Show-UDToast $Body.ContentType -Duration 2500
    }
}

You should also be able to use $Body.RawData to access the byte[] contents of the file directly. What looks like isn’t being set properly is $EventData.

This is also displaying a pop up for me.

Show-UDToast ($Body | ConvertFrom-Json)
1 Like

Interesting, I put that exact code in my test dashboard and still got errors, here’s what was in the log.

Nov 2, 2021 1:45 PM An error occurred: Cannot bind argument to parameter 'Message' because it is an empty string.
Endpoint: MyUpload
Session: 10ef99f8-5a9c-418a-9c76-a0356b83dfd7
File: 
Endpoint Start Line: 2
Endpoint End Line: 8
Stack Trace: at <ScriptBlock>, <No file>: line 2

I set my log level to debug, but don’t see any errors, lots of HTTP 200 codes, and occasionally a warning about CORS:

2021-11-02 13:52:16.329 -03:00 [INF] CORS policy execution failed.

Hmmm. That is very weird. Just to be 100% sure, you have the framework set to latest?

Yep, I had to double-check that too.
I’m linking an excerpt from our log with debug on.

debuglog2 - Pastebin.com

I’m having the same issue as Stuart I believe. If I use the latest Framework, the upload fails. It looks like the New-UDUpload function isn’t returning any data within $Data . If I switch the Framework to 3.5.0 It works. The caveat to 3.5.0 is that there is no progress bar but the uploads eventually do go through.

working example with latest framework

Show-UDModal -Content {

                            New-UDUpload -Text 'Upload File' -OnUpload { 
                    
                                $bytes = [System.Convert]::FromBase64String($Body.Data)
                                [System.IO.File]::WriteAllBytes("$TaskPath\$($Body.Name)", $bytes)
                    
                                if (Test-Path -Path "$TaskPath\$($Body.Name)") {
                    
                                    Show-UDToast -Message "File Uploaded!" -MessageColor Green -Title $($Body.Name) -Position topCenter -Duration 2500
                     
                                    Start-Sleep -Seconds 3
                     
                                    Hide-UDModal
                     
                                }

I’m getting on a call with @StuartA today because it seems like it works in some environments and not others so hopefully we can figure out what the difference is.

1 Like

Just dropping some more info that we gleaned today.

@StuartA is running PSU as a Windows Service as a service account with Windows Auth enabled. We tracked down that files are indeed getting uploaded to the temp directory for the service account: C:\users\service.account\appdata\local\temp

I have configured my PSU environment to use Windows Auth and a Windows Service and that doesn’t reproduce it and will be setting up a service account to see if that does. EDIT: Setting my service using a service account doesn’t cause the issue either

It seems like what is happening is the file is being uploaded but then the reference to the file is never being included in the endpoint so $body is $null. Trying to track down where it’s failing. Will add some additional logging and continue to try to reproduce.

1 Like