Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

FileUpload needs img to upload again and again

pillaivinit
Level 3
Level 3

upload.jpg

 I have drag n dropped a logo from DAM and clicked save. Now when I open the dialog again, I can see that the previous link of logo is there but the dialog still needs me to add image.

 

can anybody tell me why is this happening? why the image is not retained

I'm using AEM 6.3 and following is the dialog code

 

<file
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/fileupload"
autoStart="{Boolean}true"
cq-msm-lockable="/file"
fieldLabel="Upload files"
mimeTypes="[image/*]"
multiple="{Boolean}false"
name="./file"
sizeLimit="100000000"
text="Upload file"
uploadUrl="/content/dam"
required="{Boolean}true"
allowUpload="{Boolean}false"
uploadUrlBuilder=""/>
1 Accepted Solution
Manjunath_K
Correct answer by
Community Advisor
Community Advisor

@pillaivinit 

Please change mimeTypes property value as highlighted below, then it will work as expected.

 

<file
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/fileupload"
autoStart="{Boolean}true"
cq-msm-lockable="/file"
fieldLabel="Upload files"
mimeTypes="[image]"
multiple="{Boolean}false"
name="./file"
sizeLimit="100000000"
text="Upload file"
uploadUrl="/content/dam"
required="{Boolean}true"
allowUpload="{Boolean}false"
uploadUrlBuilder=""/>

 

View solution in original post

10 Replies
Mariia_Lukianet
Employee
Employee

Can you paste here how the File Upload is defined in the dialog?
And what AEM version you use.

pillaivinit
Level 3
Level 3
Sorry for not providing all the info. I have updated my question.
Manjunath_K
Correct answer by
Community Advisor
Community Advisor

@pillaivinit 

Please change mimeTypes property value as highlighted below, then it will work as expected.

 

<file
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/fileupload"
autoStart="{Boolean}true"
cq-msm-lockable="/file"
fieldLabel="Upload files"
mimeTypes="[image]"
multiple="{Boolean}false"
name="./file"
sizeLimit="100000000"
text="Upload file"
uploadUrl="/content/dam"
required="{Boolean}true"
allowUpload="{Boolean}false"
uploadUrlBuilder=""/>

 

View solution in original post

Mariia_Lukianet
Employee
Employee
granite/ui/components/foundation/form/fileupload

This is legacy Coral2 FileUpload [1], better not to use it.
Try Coral3 FilleUpload [2], does the issue persists?

granite/ui/components/coral/foundation/form/fileupload


[1] https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/granite-ui... 
[2] https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/granite-ui... 

pillaivinit
Level 3
Level 3

using Coral 3 lets me choose while . I want drag n drop so that user cannot upload anything outside DAM. Is there a  way to do this in coral3?

Sandeep6
Level 5
Level 5

Hi @pillaivinit ,

please update the dialog as below.

 

Spoiler
	<file
     jcr:primaryType="nt:unstructured"
     jcr:title="Image"
     sling:resourceType="granite/ui/components/foundation/form/fileupload"
     autoStart="{Boolean}false"
     class="cq-droptarget"
     fileNameParameter="./fileName"
     fileReferenceParameter="./fileReference"
     mimeTypes="[image]"
     multiple="{Boolean}false"
     name="./file"
     uploadUrl="${suffix.path}"
     useHTML5="{Boolean}true"/>

 

Manjunath_K
Community Advisor
Community Advisor

@pillaivinit 

Please change mimeTypes value as mentioned below.

 

mimeTypes="[image]"

 

Anudeep_Garnepudi
Community Advisor
Community Advisor

Hi @pillaivinit 

Change the mimeTypes property value to image( remove /*), that should resolve your issue.

-AG

pillaivinit
Level 3
Level 3
This fixed it . thanks Can you please tell me how to disable browsing files and only allow to drag n drop in coral 3 component. as it came to my attention I'm using coral 2 component.
Anudeep_Garnepudi
Community Advisor
Community Advisor

Use cq/gui/components/authoring/dialog/fileupload  which core v2 Image component also uses.