$handle = fopen($imageUrl, 'rb');
$imageData = stream_get_contents($handle);
At this point, $imageData can be passed to Method using the MethodAPIUpdateFile SOAP call. However, we ran into a couple of issue which are probably worth noting:
1) The MethodAPIUpdateFile expects a strFileName parameter which isn't mentioned in the API documentation.
2) After some unsuccessful attempts to update a file with improperly formatted data, all subsequent MethodAPIUpdateFile calls which used the same strFileName value failed to update the file with properly formatted data, despite a success response from the SOAP service. Seems like a potential bug with the API, which we circumvented by updating strFileName to a unique value.he solution for this ended up being fairly simple. The image data can be fetched using this basic pattern: