Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FilePicker component #3745

Merged
merged 81 commits into from
Sep 21, 2022
Merged

FilePicker component #3745

merged 81 commits into from
Sep 21, 2022

Conversation

David-Moreira
Copy link
Contributor

@David-Moreira David-Moreira commented Apr 24, 2022

Closes #3250
Closes #1184

@stsrki
Copy link
Collaborator

stsrki commented Apr 25, 2022

it looks the same as FileEdit to me

image

Is there anything special I need to enable?

@David-Moreira
Copy link
Contributor Author

David-Moreira commented Apr 25, 2022

it looks the same as FileEdit to me

image

Is there anything special I need to enable?

Nope Just use FilePicker. Strange.

Edit; Oh probably that js I added last minute broke it, maybe it's breaking behind the scnes haha I'll fix it later.

@stsrki
Copy link
Collaborator

stsrki commented Apr 26, 2022

If you upload multiple files and then remove one of them, other files start to re-upload again(progress shows). You can test with larger files.

@David-Moreira
Copy link
Contributor Author

David-Moreira commented Apr 26, 2022

If you upload multiple files and then remove one of them, other files start to re-upload again(progress shows). You can test with larger files.

I know. I copied that example from a user example, he's uploading the first file on file change. So that behaviour seems normal, right? Makes sense to trigger files changed again once a file is removed.

Most cases my guess is that File Picker upload is going to be through the upload button which is not implemented yet.

Edit : to add on to that, there is a new file status to keep track whether file has been uploaded already or not.

@David-Moreira
Copy link
Contributor Author

Yes an API that can have a file streamed to. If the streaming capability is already abstracted... the better, I just can't seem to make it work locally, at least I haven't yet.

Ideally we would just need to pass in the stream in... like in the blazor docs examples

await blobContainerClient.UploadBlobAsync(
    trustedFilename, browserFile.OpenReadStream());

image

https://docs.microsoft.com/en-us/aspnet/core/blazor/file-uploads?view=aspnetcore-6.0&pivots=webassembly

@David-Moreira
Copy link
Contributor Author

PS: Ideally your API should already work with the native InputFile for Blazor with > 2GB in WASM.

@sturlath
Copy link
Contributor

Ok what I have is this using IRemoteStreamContent there was some issue using vanilla stuff with abp.io

image

But If you got code and just want an API just send me it and I´ll publish onto our dev environment for you to use and send you the URL, no problem!

@David-Moreira
Copy link
Contributor Author

Ok what I have is this using IRemoteStreamContent there was some issue using vanilla stuff with abp.io

image

But If you got code and just want an API just send me it and I´ll publish onto our dev environment for you to use and send you the URL, no problem!

Hello,

If you can just send over email (it's on my profile) the endpoint I need to invoke and how to, I'd appreciate it.
I'd basically just be testing the Native Blazor FileInput and FilerPicker making sure they stream the > 2GB content successfully on WASM.

@David-Moreira
Copy link
Contributor Author

Ok what I have is this using IRemoteStreamContent there was some issue using vanilla stuff with abp.io
image
But If you got code and just want an API just send me it and I´ll publish onto our dev environment for you to use and send you the URL, no problem!

Hello,

If you can just send over email (it's on my profile) the endpoint I need to invoke and how to, I'd appreciate it. I'd basically just be testing the Native Blazor FileInput and FilerPicker making sure they stream the > 2GB content successfully on WASM.

Either that, or if you could take the time to test it yourself, but I understand that you might be quite busy also... :)

@David-Moreira
Copy link
Contributor Author

So trying it out with @sturlath 's api....
I must be missing something... with WASM + streaming...

I haven't even started trying to use Blazorise's FilePicker to try to stream the huge files, just straight up clearing it first with Blazor's InputFile... regular 1MB file uploads just fine, I try to upload a 100MB file, browser just straight up hangs and memory keeps growing...
image

Here's the code...

Sem Título

(Same file uploads fine through @sturlath 's swagger....)
Any ideas?

@David-Moreira
Copy link
Contributor Author

David-Moreira commented Aug 20, 2022

Well I just found this post,

dotnet/aspnetcore#43388 // dotnet/runtime#36634

this explains why I wasn't being successful streaming with a local api eitherway.

So it is seeming to me that even tough they fixed the 2gb constraint you'll still have some kind of limitations related to memory management when handling bigger files on WASM I guess?

@sturlath have you actually managed to work around wasm and "big files" in any of your implementations with other File Input components?

@David-Moreira
Copy link
Contributor Author

@stsrki go ahead and re-take a look at this when you have time.

Source/Blazorise/Utilities/IO/IFileEntry.cs Outdated Show resolved Hide resolved
WebApplication1/WebApplication1.csproj Outdated Show resolved Hide resolved
@stsrki stsrki changed the title FilePicker FilePicker component Sep 21, 2022
@stsrki stsrki merged commit fddbd2d into master Sep 21, 2022
@stsrki stsrki deleted the dev-1.1.0-FilePicker branch September 21, 2022 09:58
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FilePicker component FileEdit Progressed event does not update UI
3 participants