Can’t upload product image on eBay Error using M2ePro on Magento

After a switch to a https only setup on a Magento 1.8.0 installation using M2ePro 6.1.6 the following error ocurred when trying to list items using images:

Can’t upload product image on eBay

A quick Google search revealed the following official statement from the company behind M2ePro:

This problem does not concern to m2e pro.

The setup here uses 301 redirects to permanently redirect http requests to https, in addition to Magento being set to use secure URLs only. Despite Magento`s setting to force links to be generated https-only a quick code review of M2EPro revealed that image URLs are generated for http only. In fact, possible https links are replaced by the http ones, as shown in the prepareImageUrl method in class Ess_M2ePro_Model_Magento_Product:

private function prepareImageUrl($url) {
  if (!is_string($url) || $url == '') {
    return '';
  }

  return str_replace(array('https://', ' '), array('http://', '%20'), $url);
}

Now the first test was to change the str_replace(), thus forcing image URLs to be created https only:

return str_replace(array('http://', ' '), array('https://', '%20'), $url);

This forces links to be prefixed with the https:// protocol. Now it should work, right? Since M2ePro receives working secure image URLs that it can forward to eBay which in return fetches them on demand. Wrong! It seems like there is a general problem with eBay being able to process https image URLs. So, currently the only option seems to allow unsecure http image URLs to be fetched by eBay. An statement from eBay support did not resolve the problem at hand:

If the direct image upload is working and you are able to list products it’s not a problem related to eBay.

I will report back in case the SSL problem with image URLs get resolved.

You may also like...

1 Response

  1. Hi, Did you ever find a fix for this issue. I have just moved a site to a different server and this is now doing it intermittently?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.