When migrating to AEM 6.2 (we’re using SP1), the dialog for uploading images (or any other file) may not work with your existing configuration.
Affected are dialog items with sling:resourceType=”granite/ui/components/foundation/form/fileupload”.
The fix is very easy: Simply add this property to the configuration node:
1 |
uploadUrl="${suffix.path}" |
In the documentation Adobe describes field uploadUrl as “The URL where to upload the file, you can use ${suffix.path}
to use the current suffix”. It seems that value ${suffix.path}
is what you need to put to get the default behavior.
However, there is another catch: in our tests, setting the image/file upload to mandatory breaks the functionality.
To make it work, remove the following property if present:
1 |
required="true" |
Hopefully, Adobe will fix this soon…
here is a full configuration of the upload item that works for us:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<file jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/fileupload" autoStart="{Boolean}false" class="cq-droptarget" title="Image" fieldLabel="Image from Dam" fileNameParameter="./fileName" fileReferenceParameter="./fileReference" mimeTypes="[image]" multiple="{Boolean}false" name="./file" useHTML5="{Boolean}true" uploadUrl="${suffix.path}"/> |