Occasionally when working on a post or page in WordPress you may encounter an error when trying to upload an item to the Media Library.
This error is generally caused by a client-side or user error (your login session, bad characters in the file name, etc.).
First, save your work on the page and then attempt to reload the page. Since this error is often caused by a user session expiring, reloading the page will force you to log in again and generate a new session. After that you can resume working on your page.
If the first option does not correct the issue, the issue may be due to the file name you’re attempting to upload. Avoid using special characters or non-UTF-8 characters in your file names.
Personally, I try to use only lowercase letters or numbers and I substitute spaces for underscores. This helps keep a tidy Media Library and ensures my media is accepted by the media library.