0

I need to know what may be causing the issue (wysiwyg is not under storage root path.) of not being able to upload image. Any idea would help alot.

Here is a screenshot of the error message with red highlight enter image description here

  • try to upload image in other browser – inrsaurabh Apr 2 '18 at 3:44
2

looks like you are using the latest Magento 2.2.3. They did some security improvements that prevent using symlinks and so.

Maybe this issue will help you: https://github.com/magento/magento2/issues/13929

| improve this answer | |
2

As of 2.2.3, it's not possible to upload images via the WYSIWYG if the media directory is a symlink. This is due to this new file. UPDATE: This issue has been fixed in Magento 2.2.5 and 2.3.0. See this Github issue and the fix.

Workaround

We've temporarily fixed this by changing this line from this:

$realPath = realpath($path);
$root = $this->directoryList->getPath($directoryConfig);

to this (note the addition of the realpath function call):

$realPath = realpath($path);
// BEGIN EDIT
/**
 * Since media directory is a symlink, need to run both paths through realpath in order for the comparison to
 * work.
 * The proper fix for this should involve a STORE > Configuration setting where an admin can choose whether to
 * allow symlinked directories.
 */
$root = realpath($this->directoryList->getPath($directoryConfig));
// END EDIT

All information taken from this ticket as pointiA mentioned.

| improve this answer | |
0

Daniel First, you can open a terminal then you can go in your Magento files then you can give permission Pub folder.

chmod -R 777 pub/

if can't working this commnad you can try to sudo chmod -R 777 pub/

| improve this answer | |
0

You have a problem with permissions.

**For Linux* - You must run this commands:

find ./pub/media -type d -exec chmod 777 {} \;

For Window - You must create a folder wysiwyg in this path C:/xamp/htdocs/rohivic/pub/media/ and you click right on project folder to Properties and you must be unchecked the Read Only.

| improve this answer | |
  • I am on local host using xampp. Not a live server. How do i go about that? – Daniel Apr 1 '18 at 21:22
  • I updated my answer. – St3phan Apr 1 '18 at 21:27
  • Thank you St3phan for your effort. But somehow the problem seem persistent. Any more suggestions? – Daniel Apr 1 '18 at 21:47
  • I updated again my answer. I added to create the folder wysiwyg – St3phan Apr 2 '18 at 8:06

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.