WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #40445, comment 1


Ignore:
Timestamp:
04/17/2017 06:28:47 PM (3 years ago)
Author:
redsweater
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #40445, comment 1

    initial v1  
    11Based on my experience working with the limitations of the WordPress XMLRPC API, I would say this issue is almost certainly based on the size of the image somehow overwhelming the server's PHP instance such that it can't handle the upload.
    22
    3 To upload images via XMLRPC the client has to convert the image to base64 and encode the entire image into a single POST request to the XMLRPC API endpoint. At this point the server process, in PHP, has to unwrap the entire XML file and handle each of the arguments separately. In the case of image data this means decoding from base64 back to binary data, and then performing whatever additional processing is necessary.
     3To upload files via XMLRPC the client has to convert the image to base64 and encode the entire file into a single POST request to the XMLRPC API endpoint. At this point the server process, in PHP, has to unwrap the entire XML file and handle each of the arguments separately. In the case of file data this means decoding from base64 back to binary data, and then performing whatever additional processing is necessary.
    44
    55There may be tweaks that could be done in the XMLRPC library or in WordPress to treat file uploads differently from other API requests, but this is a long-lived problem that seems unlikely to be worth addressing if the newer REST API handles it more efficiently. (https://developer.wordpress.org/rest-api/reference/media/#create-media)