question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: MudExUploadEdit totally breaks application.

See original GitHub issue

Contact Details

No response

What happened?

MudBlazor: 6.8.0 Ex: 1.7.64

When I try to upload files (or even select them), server freezes and after some time this happens: image image

It happens always besides when I try to upload this one file, but even it breaks everything: image

It saves same way then: image

My code:

	<MudExUploadEdit @bind-UploadRequests="files" MimeTypes="@mimeTypes" T="UploadableFile" Style="height: 400px; max-height: 400px; width: 800px" AllowMultiple="true" />
	<MudButton OnClick="@UploadFiles">upload</MudButton>


@code {
	private string[] mimeTypes =
	{
        "image/*"
    };
	IList<UploadableFile> files;
	private async Task UploadFiles()
	{
		string fileStorage = Configuration.GetValue<string>("FileStorage")!;
		foreach (var file in files)
		{
			Directory.CreateDirectory(Path.Combine(fileStorage, "CARD"));
			string newName = Path.GetRandomFileName(); 
			string newFileName = Path.ChangeExtension(newName, Path.GetExtension(file.FileName));
			string path = Path.Combine(fileStorage, "CARD", newFileName);
			await File.WriteAllBytesAsync(path, file.Data);
		}
	}

Edit: I managed to upload one webp file too somehow, but others don’t work.

Expected Behavior

To not freeze

Screenshots

No response

What browser are you using?

Chrome

Sample Solution

No response

Pull Request

No response

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 months ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
J3ster1337commented, Aug 14, 2023

Wow thanks!!! Yes, now any file (or multiple files) can be uploaded without the bug occurring. The library is totally mind-blowing ❤️

1reaction
fgildecommented, Aug 4, 2023

I will have a look after vacation. Looks like wrong jsruntime is used. But I will fix it. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

fgilde/MudBlazor.Extensions
MudExUploadEdit. This component provides multi-file upload functionality, with features like duplicate checks, max size, specific allowed content types, max ...
Read more >
MudBlazor.Extensions 1.7.47
MudBlazor.Extensions. MudBlazor.Extensions is a small extension for MudBlazor from https://mudblazor.com/ · Running Sample Application (Azure)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found