Upload Assets to FTP server | Community
Skip to main content
Level 2
September 22, 2023
Solved

Upload Assets to FTP server

  • September 22, 2023
  • 2 replies
  • 2096 views

Hi all,

i've a requirement to upload assets to a remote ftp server. (AEM as a Cloud Service)

I basically added a servlet to be able to call the action from the Asset UI. Then i'm using the Job Manager to create a async job to make the call the FTP server.

My question is regarding the FTP dependency, i mean what library should use for the ftp connection. I tried with Apache Commons Net but there is not a bundle for this library.

I've embedded the jar but I've an error,

org.apache.commons.net.ftp at startup level 20 but no packages export them for that startup level.

 

 

 

Any opinion or comment is welcome.

 

Thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by VictorToledo

I finally have a solution that works.

I've implemented a FTP client with Java IO. Then i added a new quick action button on the Asset Details action bar, so the user is able to select an asset or multiple assets and send them to the FTP server.

When the user clicks the ftp button, a new Sling job is created, the sling job uses the FTP Client to send the assets to the FTP server and at the end sends a notification to the user.

 

 

 

Regards!

2 replies

krati_garg
Adobe Employee
Adobe Employee
September 23, 2023

Hi @victortoledo To upload Asset into AEMaaCS programmatically, please refer to following APIs available:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/developer-reference-material-apis.html?lang=en

 

aem-upload APIs are best suited in your usecase. Please check the code sample here:

https://github.com/adobe/aem-upload

Level 2
September 23, 2023

hi @krati_garg thanks but i need send assets from AEM instance to FTP server

krati_garg
Adobe Employee
Adobe Employee
September 23, 2023

@victortoledo Alright, query appeared to be other way round. You will have to use Asset Download Service.
To enable the service (if it is already not enabled):

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/manage/download-assets-from-aem.html?lang=en

 

API details:https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/dam/api/jobs/AssetDownloadService.html

Use : 

 assetDownloadService.assetDownload




VictorToledoAuthorAccepted solution
Level 2
October 4, 2023

I finally have a solution that works.

I've implemented a FTP client with Java IO. Then i added a new quick action button on the Asset Details action bar, so the user is able to select an asset or multiple assets and send them to the FTP server.

When the user clicks the ftp button, a new Sling job is created, the sling job uses the FTP Client to send the assets to the FTP server and at the end sends a notification to the user.

 

 

 

Regards!