Skip to main content

Files do not upload

An upload passes through the browser, anything in front of your site, the web server, PHP and then WordPress. Each of them can refuse it. These checks find which one does.

1. Does WordPress itself take the file?#

Upload the same file under Media → Add New in the WordPress admin.

  • It fails there too. The problem is the server, not Better Messages: the disk quota of the hosting account is full, a security module drops uploads, or the limits of PHP are too low. Ask the host, and say that uploads fail in the Media Library as well.
  • It works there. Go on.

2. Is the file within the limits of the plugin?#

Under Settings → Attachments:

  • Max File Size is the limit for one file, and Max File Size by Type can give one type more room, such as videos.
  • Allowed Formats lists the types members can send. A format that is not ticked is refused. See Add a custom file format.
  • Max Attachments per Message limits how many files one message carries.

3. Try the other upload method#

Settings → Attachments → Upload Method has two ways to send a file:

  • TUS (Resumable Upload) sends the file in pieces and resumes after an interruption. It is not held back by the upload size limits of PHP. Some hosts with a strict firewall block it.
  • Standard POST Upload sends the file in one request, as the Media Library does. It is limited by upload_max_filesize and post_max_size of PHP.

If uploads fail on one method, switch to the other and try again. Large videos need TUS, or higher PHP limits from the host.

4. Is a firewall refusing the request?#

Open the browser console (F12, then Network), send a file, and look at the request that fails.

  • 403 Forbidden: a firewall refused it. Turn on Settings → Attachments → Randomize Filenames, which replaces long names, names in a non-Latin alphabet and unusual characters with plain names before the upload. If it stays, ask the host which rule blocked the request.
  • 413 Request Entity Too Large: the web server limits the size of a request. On the POST method, ask the host to raise the limit, or use TUS.
  • A CORS error in the Console tab: the files of the site are served through a CDN that does not pass the CORS headers of your site to the browser, so the browser blocks the upload. Ask whoever set up the CDN to pass the CORS headers of the site through.

5. Cloud storage#

When files are kept in cloud storage, the browser sends each file straight to the bucket, which has to allow uploads from your site with a CORS rule. When the bucket refuses, files go through your server instead, so sending does not fail, and the line of the storage says Needs attention. Press Test Connection on the storage, and follow the guide of your provider for the CORS rule.

Photos and videos from phones#

  • Photos from an iPhone are HEIC files, which the plugin always converts in the browser before sending.
  • Videos from a phone are large, and often in a format other devices cannot play. Settings → Attachments → Optimize Videos converts MOV, AVI, WMV and MKV to MP4 in the browser, with the Video Engine. Press WASM Headers Test there to check that your server sends its files correctly.
  • A video is too large for Max File Size: raise the limit for videos alone with Max File Size by Type.

Animated GIFs stop moving#

See Animated GIFs stop moving.

Voice and video messages#

They are files too, and count as audio and video under Max File Size by Type. For the add-on itself, see Voice and Video Messages.

See also#