I just installed php-cuong customer avatar on magento 2.1.8.

My problem is that when I want to upload an image in customer panel it has error and not to upload image. In admin panel, customer tab when I choose a customer and upload image it saves in pub/media but not show avatar and sends error.

  • Hello @pegah, any solution worked for you ? – Pawan Jun 26 '18 at 17:22
  • No, i just tried myself and create another module – MGPM Jul 1 '18 at 4:34
  • Great, I have also created a module for customer Avatar – Pawan Jul 1 '18 at 5:02
  • Sounds nice! could you please share it with me? – MGPM Jul 8 '18 at 9:08

Well, Its well known M2 Bug/Issues.

Its fixed in develop branch,

For work around you can modify below file to make it work.


Around line 113

Replace below :

 $result['tmp_name'] = $result['path'] . '/' . ltrim($result['file'], '/');

Replace with :

$result['tmp_name'] = ltrim($result['file'], '/');

Clear cache and Try to upload an image from admin.

It should work.

  • if it resolve your issue, Than accept answer to help other community. – anonymous Mar 17 '18 at 10:54
  • Thanks for your kind response, but not work for me, could you please install the module? if it is possible for you – MGPM Mar 17 '18 at 11:10
  • What do you mean by install module ? – anonymous Mar 17 '18 at 11:13
  • (github.com/php-cuong/magento2-customer-avatar) install it please, you can see whats wrong with him, as i said above, it doesnt save image from customer panel – MGPM Mar 17 '18 at 11:17
  • @pegah, You have issues from frontend OR backend ?!! Above you mention that you have issues from admin image upload. ?? – anonymous Mar 17 '18 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.