froala / wysiwyg-editor

The next generation Javascript WYSIWYG HTML Editor.
https://www.froala.com/wysiwyg-editor
Other
5.3k stars 675 forks source link

Incorrect error message in upload too large file #4411

Open grogy opened 2 years ago

grogy commented 2 years ago

If you have a feature suggestion, please add it on the Feature List instead.

Expected behavior.

I expect message File is too large after drag and drop big file to textarea.

Actual behavior.

I see general message Something went wrong. Please try again.

Steps to reproduce the problem.

HTML sample for test behaviour:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
</head>
<body>
<div id="froala-editor"></div>
<script>
    let fileUploadURL = 'https://webhook.site/458b589a-3e33-4430-b888-e601ea2c97ae';
    new FroalaEditor('div#froala-editor', {
        heightMin: 150,

        // Set the file upload URL.
        fileUploadURL: fileUploadURL,
        filesManagerUploadURL: fileUploadURL,

        // Set request type.
        fileUploadMethod: 'POST',
        filesManagerUploadMethod: 'POST',

        // Set max file size to 10MB.
        fileMaxSize: 10 * 1024 * 1024,
        filesManagerMaxSize: 10 * 1024 * 1024,

        // Allow to upload any file.
        fileAllowedTypes: ['*'],
        filesManagerAllowedTypes: ['*'],
    });

</script>
</body>
</html>
Editor version.

I tested in 4.0.6 and current version 4.0.9.

OS.

Linux

Browser.

Firefox

Recording.

1) I take file bigger than set limit. In example file bigger than 10MB. 2) I put file in file manager. I see correct red message File is too large 3) I put file to textarea. I see incorrect message Something went wrong. Please try again.

chipncharge commented 7 months ago

Did you ever figure out how to solve this? This is a problem for me as well.