Hi,
I'm try to use fileinput component
In my project, fileinput return Unable to read file as base64 string. A task was canceled.
then Attempting to reconnect to the server..
but it work on blazor.radzen.com/fileinput (same image and same code)
Is there any mistake in this?
enchev
January 25, 2021, 12:22pm
2
Such error might happen if the image is too big
thank you
but only about 100kb image(?
And why doesn't this error occur on the sample page?
enchev
January 25, 2021, 12:33pm
4
I’m afraid that in this case I don’t have any other ideas.
I try to find the limit
and I found that the largest file uploaded was 24513 bytes(about 23.9kb)
I don't know what's special about it
Try increasing the Hub options limit:
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpContextAccessor();
services.AddRazorPages();
services.AddServerSideBlazor().AddHubOptions(o =>
{
o.MaximumReceiveMessageSize = 10 * 1024 * 1024;
});
services.AddScoped<ThemeState>();
services.AddScoped<ExampleService>();
services.AddScoped<NorthwindContext>();
services.AddScoped<DialogService>();
services.AddScoped<NotificationService>();
services.AddScoped<TooltipService>();
services.AddScoped<ContextMenuService>();
services.AddScoped<NorthwindService>();
2 Likes
It works!
Thank you very much.!