Repository navigation
Uploads from the editor's media library modal still go through the server #82409
Description
I ran into this while testing HEIC uploads: the same file succeeds when dropped on an Image block and fails when dropped on the Insert image->from Media Library option,
Here is a failure trying to upload an AVIF which is supported under client side media:
Screencast below.
Claude wrote this up after going through the screencast and the code:
Description
Dropping an image directly on an Image block runs it through the client-side media pipeline: a HEIC file is converted to JPEG in the browser and the upload succeeds. Opening the media modal from the same block (the "Media Library" button, then either the "Upload files" or the "Media Library" tab of the "Select or Upload Media" dialog) and dropping the same file there goes through
wp.Uploader/ plupload toasync-upload.php, and the server rejects it with "The server cannot process HEIC images. Convert it to JPEG before uploading."The client-side pipeline is wired in through the block editor's
mediaUploadsetting in https://github.com/WordPress/gutenberg/blob/trunk/packages/block-editor/src/components/provider/index.jsx, which only covers uploads the editor itself starts (block drops, the Upload button, the inserter). The modal is Backbonewp.media, and its uploader is core'swp.Uploaderin https://github.com/WordPress/wordpress-develop/blob/trunk/src/js/_enqueues/vendor/plupload/wp-plupload.js, which nothing intercepts. So it posts the original bytes server-side even though the page is already cross-origin isolated and@wordpress/upload-mediais loaded and configured.Beyond HEIC, files dropped on the modal skip everything the pipeline does: browser-generated sub-sizes, the big-image threshold, animated GIF handling, and so on. Users are unlikely to notice which surface they used, so the two behaving differently reads as flaky.
Step-by-step reproduction instructions
- On a site with client-side media processing enabled (WordPress 7.1+ or trunk), open a post in the editor in a browser where the pipeline runs (Chrome 137+, or Firefox with COEP/COOP headers).
- Add an Image block and drop a HEIC file (any iPhone photo) on it. It converts and uploads.
- Add another Image block, click "Media Library", and drop the same HEIC file on the modal.
Expected behaviour
The modal upload runs through the same client-side pipeline as the block drop, so the HEIC is converted in the browser and the upload succeeds.
Current behaviour
The modal posts the raw file to
async-upload.phpand shows "The server cannot process HEIC images. Convert it to JPEG before uploading." in the modal's error sidebar.Possible approach
On editor screens where the pipeline is active, bind a higher-priority
FilesAddedhandler onwp.Uploaderinstances (the modal's included) that routes the files through the@wordpress/upload-mediastore and mirrors plupload's placeholder attachments, progress, andwp.Uploader.errorsso the modal UI works unchanged. That is what WordPress/wordpress-develop#12585 does for the Media Library grid and the Add New Media File screen outside the editor, and the same wrapper could cover the modal. Whether this belongs in core (wp-plupload.jsdetecting an active pipeline itself) or in Gutenberg is an open question.Related: WordPress/wordpress-develop#12585 (core PR for the Media Library screens), adamsilverstein/client-side-media-everywhere#49 (plugin version of the same)
The modal should use the same client side media processing we use elsewhere as long as it is available.
Screencast
media.library.in.editor.mp4
AI Use
Description written with 🤖 Claude Code.
Activity
adamsilverstein commentedon Sep 4, 2026
Possibly fixed by
adamsilverstein commentedon Sep 4, 2026
I verified this is not fixed by WordPress/wordpress-develop#12585 alone by opening that PR in playground and then reproducing the bug in the editor. Maybe we need to apply similar changes here?
Going here:

I see errors uploading AVIF:
[-]Client-side media: uploads from the editor's media modal still go through the server[/-][+]Uploads from the editor's media library modal still go through the server[/+]andrewserong commentedon Sep 7, 2026
Thanks for opening the issue! This one tracks the work for integrating into the existing (core) media modal. Not urgent as it's still behind an experiment, but we also have the experimental dataviews-powered media modal, so at some point we'll want to look at wiring that up, too, I expect. (Just mentioning now in case you wanted to track it here, otherwise we can open a separate issue)