In the Magento\Framework\File\Uploader, there is a variable name $_enableFilesDispersion:

 * If this variable is set to TRUE, files dispertion will be supported.
 * @var bool
 * @access protected
protected $_enableFilesDispersion = false;

My mother tongue is not English, so I do not understand the "files dispertion", what's the meaning of "files dispertion"?

If I set $_enableFilesDispersion = true;, what will happen?

1 Answer 1


if you set $_enableFilesDispersion = false; it will simply upload the file to the directory, but if you set it to true code will create subfolders with the image name's first two letters and then store the image there.

for eg. - an image having the name abc.jpg will be stored under your_directory/a/b/abc.jpg while $_enableFilesDispersion = true; otherwise it will be stored under your_directory/abc.jpg

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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