Shopware 6 is an open commerce platform based on Symfony Framework and Vue and supported by a worldwide community and more than 1.500 community extensions
The component sw-media-upload-v2, used on an admin page, has an attribute "defaultFolder", in the documentation it's described as "The path where the file will be put". The attribute is ignored though, placing the file in the root media directory. Same behaviour whether the specified folder already exists or not.
PHP Version: 8 | Shopware Version: 6.6 | Affected area / extension: Platform(Default)
Actual behaviour:
The component sw-media-upload-v2, used on an admin page, has an attribute "defaultFolder", in the documentation it's described as "The path where the file will be put". The attribute is ignored though, placing the file in the root media directory. Same behaviour whether the specified folder already exists or not.
<sw-media-upload-v2 uploadTag="myTag" :allowmultiselect="false" variant="regular" :autoupload="true" label="My image-upload" defaultFolder="MyCustomFolder"></sw-media-upload-v2>
Expected behaviour:
The file should be placed in the directory specified.
How to reproduce:
use the media-upload-v2 component on a custom admin page:
<sw-media-upload-v2 uploadTag="myTag" :allowmultiselect="false" variant="regular" :autoupload="true" label="My image-upload" defaultFolder="MyFolder"></sw-media-upload-v2> <sw-upload-listener @media-upload-finish="(event) => onUploadFinish(event, surface)" auto-upload uploadTag="myTag"></sw-upload-listener>
The uploaded file will be placed in the root media directory, instead of "MyFolder".