0

I am using the guidefileupload out-of-the-box component in my Adobe Forms, but unfortunately the component won't work because of some business requirements:

  • All uploaded files must be stored outside of the default AEM CRX repository. I want to setup a new fileshare on my server and upload all files used only in the guidefileupload component to that location (the DAM won't work because it's part of CRX/AEM).
  • I need all of the uploaded files to be Base 64 encoded.

Does anyone have any good suggestions as to what component to use or how to approach this problem?

ews2001
  • 2,176
  • 3
  • 26
  • 38

2 Answers2

1

There are multiple ways to achieve it depending upon your architecture -

  • If you want to do it within AEM and store the content outside CRX, you could write a connector to a DB or extend on the Social Communities functionality that stores data in to separate Mongo DB instance. Refer to Adobe's documentation here. Basically there is nothing OOTB box to use as is, what you can do is adapt to this concept and have something of your own that does the same.
  • Another approach is that you have a separate container running which hosts a servlet to accept the POST content (your file/asset) and persist it to DB. To work on this approach you could refer to RequestDispatcher for remote server?

For Base64 encoding you could do that either on your other container refer to Apache Commons Codec and if implementing within AEM you could use org.apache.jackrabbit.util.Base64

Community
  • 1
  • 1
Ameesh Trikha
  • 1,652
  • 2
  • 12
  • 18
  • Thanks @Ameesh, we'll investigate each of these approaches and let you know if any of them work for our solution. – ews2001 Aug 08 '16 at 23:15
1

This question is quite old, but I thought I would chime in. As mentioned previously, there are several options to handle this but one of the easiest by far would be to create a submission servlet and to configure your Adaptive Form to submit to a REST endpoint, which would effectively be your servlet: Adobe-Consulting-Services/acs-aem-samples - SampleAllMethodsServlet.java

By handling multipart parameters in your servlet, you would be able to handle the uploaded file attachments, and store them where ever you would like: Handling File Upload in Adobe CQ

Optionally, things like database connectors can be configured to store these attachments as well: Injecting a DataSourcePool Service into an Adobe Experience Manager OSGi bundle

GuillaumeCleme
  • 317
  • 1
  • 2
  • 10