Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#58513 new defect (bug)

Uploading JSON file of 1MB or less fails to upload

Reported by: oliwardgmailcom's profile oliward@… Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.2.2
Component: Upload Keywords:
Focuses: Cc:

Description

When uploading a JSON file of exactly 1048577 bytes or less leads to:

{filename} has failed to upload.
Sorry, you are not allowed to upload this file type.

Even though the file type is allowed. Tested with JSON file of valid JSON of 1048578 bytes (success) and 1048577 byes (failure).

Attachments (2)

more-than-1mb.json (1.0 MB) - added by oliward@… 2 years ago.
JSON file of arbitrary contents and size of more than 1 MB (1048578 bytes)
exactly-1mb.json (1.0 MB) - added by oliward@… 2 years ago.
JSON file of arbitrary contents and size of exactly 1 MB (1048577 bytes)

Change History (3)

@oliward@…
2 years ago

JSON file of arbitrary contents and size of more than 1 MB (1048578 bytes)

@oliward@…
2 years ago

JSON file of arbitrary contents and size of exactly 1 MB (1048577 bytes)

#1 in reply to: ↑ description @oliward@…
2 years ago

Replying to oliward@…:

Worth noting this was initially discovered on a multisite installation, but also tested on a fresh WP setup, non-multisite, after allowing JSON file upload with:

`
add_filter('upload_mimes', function ($mimes) {

$mimesjson? = 'text/plain';
return $mimes;

});
`

When uploading a JSON file of exactly 1048577 bytes or less leads to:

{filename} has failed to upload.
Sorry, you are not allowed to upload this file type.

Even though the file type is allowed. Tested with JSON file of valid JSON of 1048578 bytes (success) and 1048577 byes (failure).

Version 0, edited 2 years ago by oliward@… (next)
Note: See TracTickets for help on using tickets.