Make WordPress Core

Opened 5 years ago

Last modified 3 years ago

#45562 new defect (bug)

drag and drop file upload fails with empty files when dragging from macOS Preview into WP on Safari 12

Reported by: dbcarlton's profile dbcarlton Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.0
Component: Media Keywords:
Focuses: Cc:

Description (last modified by johnjamesjacoby)

Part of my workflow involves opening multiple files in Preview (on macOS), and then adding them to WordPress by dragging and dropping them to the Add Media page in WordPress (running in Safari). That used to work fine, but when I upgraded to Safari 12.0, I get the error:

"File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini."

I'm using self-hosted WordPress (on both Ubuntu 11.04 or 11.10, with Apache 2.4 as the web server); I don't think I made any server-side configuration changes when this started happening, though it's possible I upgraded Apache versions at about the same time? This occurs in WordPress 5.0, and also occurred in WP 4.x versions; again, I don't think it was caused by a WP change, though I can't rule out a WP upgrade at about the same time.

This works fine when dragging and dropping from Finder, it's only when dragging and dropping from Preview.

To reproduce:

  • Select multiple images and open them up in Preview.
  • Go to Add Media in WordPress in Safari 12.
  • Drag one of the images from the Preview sidebar to Wordpress.

I get the above file upload error when I do this.

Change History (2)

#1 @johnjamesjacoby
5 years ago

  • Description modified (diff)

I’ve also seen this, but I think it’s possible this is actually bug in macOS Mojave.

I suspect Safari is seeing the thumbnail as the upload, and not the original file that the thumbnail represents.

Because thumbnails are cached in user directories with permissions restrictions, Safari basically is the drop-target of a zero-byte file.

It’s definitely weird, whether my theory is right or wrong.

This ticket was mentioned in Slack in #core-media by a223123131. View the logs.


3 years ago

Note: See TracTickets for help on using tickets.