Expand my Community achievements bar.

SOLVED

Upload Assets to FTP server

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Level 3

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.

 

Screenshot 2023-09-27 at 11.30.12.png

 

Screenshot 2023-09-27 at 11.31.27.png

 

Regards!

View solution in original post

5 Replies

Avatar

Employee Advisor

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/develo...

 

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

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

Avatar

Level 3

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

Avatar

Employee Advisor

@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/downl...

 

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

Use : 

 assetDownloadService.assetDownload




Avatar

Level 3

No, i dont need to download assets. It is a "server to server" connection. AEM server to FTP server.

Avatar

Correct answer by
Level 3

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.

 

Screenshot 2023-09-27 at 11.30.12.png

 

Screenshot 2023-09-27 at 11.31.27.png

 

Regards!