[wp-trac] [WordPress Trac] #17604: wp.uploadFile overwrite doesn't work

WordPress Trac noreply at wordpress.org
Wed Jun 24 14:22:15 UTC 2015


#17604: wp.uploadFile overwrite doesn't work
---------------------------------+-----------------------------
 Reporter:  M66B                 |       Owner:
     Type:  defect (bug)         |      Status:  new
 Priority:  normal               |   Milestone:  Future Release
Component:  XML-RPC              |     Version:
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 3.6-early  |     Focuses:
---------------------------------+-----------------------------
Changes (by tohokuaiki):

 * version:  3.2 =>


Comment:

 Replying to [comment:9 marco_hoyer]:
 Hi, I also encounter this curious behavior about overwrite parameter of
 XMLRPC uploadFile.

 WordPress version is 4.2.2.

 I expect that when overwrite parameter is true, an attachment file which
 has same filename and inherits same post id should be removed, and new
 attachment file via XMLRPC should be registered.

 However, actually each time I post the attached file each time, I found
 that files continue to increase.
 {'type': 'image/jpeg', 'id': '571', 'file': 'wpid-test.jpg'}
 {'type': 'image/jpeg', 'id': '572', 'file': 'wpid-test1.jpg'}
 {'type': 'image/jpeg', 'id': '573', 'file': 'wpid-test2.jpg'}
 {'type': 'image/jpeg', 'id': '574', 'file': 'wpid-test3.jpg'}
 {'type': 'image/jpeg', 'id': '575', 'file': 'wpid-test4.jpg'}
 ....

 And, in case of "overwrite" parameter is false, every time I post I can
 get
 {'type': 'image/jpeg', 'id': '571', 'file': 'test.jpg'}
 {'type': 'image/jpeg', 'id': '572', 'file': 'test1.jpg'}
 {'type': 'image/jpeg', 'id': '573', 'file': 'test2.jpg'}
 {'type': 'image/jpeg', 'id': '574', 'file': 'test3.jpg'}
 {'type': 'image/jpeg', 'id': '575', 'file': 'test4.jpg'}

 What exactly is going on? :-?

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


More information about the wp-trac mailing list