Expand my Community achievements bar.

SOLVED

AEMaaCS file upload on published url - best practices

Avatar

Level 10

Hello all,

I have a requirement to upload assets on AEMaaCS publish instance via dispatcher and cdn url ,that can be images pdf of certain sizes on publisher via a form (not AEM form) exposed to the public. This then syncs the data keyed in to a 3rd party data store , this also includes persisting of the uploaded files to the 3rd party data store.

questions I have are while I can implement a simple form post exposed to public, without saving data into AEM 

1. is there a best practice to implement the upload files functionality on published url with and without scanning? Does it need to be restricted in terms of file size . 

2. Does it need to be stored in a temp location or can I post it to a third party data store directly . 
3. Any other gotchas

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
10 Replies

Avatar

Community Advisor

@NitroHazeDev If the final goal is to send the form data to third party, why to bring it to AEM side. I would do form submission to the third party datastore with the assumption there is endpoint in third party side to consume the submitted form. Bringing it into AEM includes updates to dispatcher/akamai and it increases the complexity for nothing since you are not gonna keep it in AEM data store.

Hi,

Thank you for the response but I am not sure I get the answer to the 3 points. I get the point on data store but there has to be scanning done and for that there is a need to have a temp store vs scanning via reading input stream IMO 

Kindly let me know 

Avatar

Community Advisor

Hi, 

Answering your questions:

  1. I think the recommendation is not to upload assets directly into a publish instance for many reasons, but especially because of how the assets are processed in AEM as a Cloud Service (AEMaaCS). The recommended approach is to use aem-upload: aem-upload GitHub Repository

  2. In my humble opinion (IMHO), I would store the assets externally, utilizing whatever storage option you have available, and then sync them back to AEM. You could consider using the storage available as part of App Builder: App Builder Storage Libraries Documentation

  3. Make sure you sync to the author and replicate to publishers. I think that would be your best approach to elaborate on.

Hope this helps.



Esteban Bustamante

Avatar

Level 10

Hi @EstebanBustamante how does sync to author happen since AEMaaCS does not have reverse reverse replication ?

Avatar

Community Advisor

Hi,

 

As I explained, you should avoid such scenarios and instead upload the assets to the author instance. Then, you can use regular forward replication from author to publish.

 

Hope this helps.



Esteban Bustamante

Avatar

Level 10

@EstebanBustamante 

this was more towards the sync comment on #3 but I guess I misread it as sync  between AEM instances 

My intent has been misinterpreted somehow, perhaps with the word “publish”, my bad . The ask and intent was public users accessing AEM (publish behind dispatcher) and uploading assets say an upload button on a form that needs scan prior to storing it in an external storage system. Is there a way to scan files and best practices when one uploads to a published url 

 

 

I also believe the option 2 is the best to proceed over option 1 for a simple upload and especially when you need to scan and AEM has no options to scan file ?

 

Option1 seems an overkill . looking at the code - sync to an AEM instance (author or pub- auth has been mentioned but I would say it is configurable ) and more. 

can you tell me more in app builder , not sure I follow it’s use and integration to AEM and it’s purpose 

Avatar

Community Advisor

Here you have some useful links: 

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/con...

https://developer.adobe.com/app-builder/docs/getting_started/ 

I try to put something together for further reference, but it will take me some time will post back to this.

Hope this helps.



Esteban Bustamante

Avatar

Correct answer by
Community Advisor

@NitroHazeDev i think this is a good approach to follow as well for your use case: https://blog.developer.adobe.com/introduction-to-aem-as-a-cloud-service-asset-upload-http-api-fc560f... 



Esteban Bustamante

Avatar

Community Advisor

@NitroHazeDev Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community



Esteban Bustamante

Avatar

Level 10

@EstebanBustamante  I don’t think there is a need for me to mark it correct since someone automatically marked it right. Would have appreciated time to review the comment. Thank you for the response it helped as well