[wp-trac] [WordPress Trac] #32318: Upload fails, wp_insert_attachment returned 0

WordPress Trac noreply at wordpress.org
Thu May 16 00:46:25 UTC 2019


#32318: Upload fails, wp_insert_attachment returned 0
--------------------------------+------------------------------
 Reporter:  programmin          |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Upload              |     Version:  4.1.5
 Severity:  normal              |  Resolution:
 Keywords:  close dev-feedback  |     Focuses:  administration
--------------------------------+------------------------------

Comment (by joemcgill):

 It looks like the documentation for `wp_insert_attachment()` have since
 been updated to account for the case of `0` being returned.

 We could attempt to have a garbage collection job for files that are
 successfully uploaded, but fail to be inserted to the database, maybe? I
 agree that this is currently not ideal.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/32318#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list