Alfresco Integration


The Alfresco source is currently only available when using the v2 libraries.

Uploads from the Alfresco API support the following types of files:

All file types are selectable. This includes audio, video, image, text, office, and compressed archive files.

Section Quick Jump:

API OAUTH Webhooks

Using the Alfresco API

  1. User selects Alfresco from services list
  2. user authenticates connection by logging into Alfresco account
  3. user is connected and can select files from Alfresco in Filestack dialog

Alfresco api upload widget

Upload from Alfresco

Uploading or "picking" a file from Alfresco in the context of Filestack means choosing a file and creating a distributable link to that file where it exists in Alfresco. This is the Filestack URL that all "Pick" functions return. If you are using the pickAndStore method, then the file from Alfresco is copied to a new storage location.

Sample Upload Code
filepicker.pick( { mimetypes: ['*/*'], services:['ALFRESCO'], }, function(Blob){ console.log(JSON.stringify(Blob)); } );

Download to Alfresco

Exporting a file to Alfresco in the context of Filestack means saving a file from a url or Filestack Blob object to Alfresco and creating a distributable link to that file where it exists in Alfresco. This is the Filestack URL that the "export" function returns.

Sample Export Code
filepicker.exportFile( '', { mimetype:'*/*', suggestedFilename: 'newFile', services: ['ALFRESCO'] }, function(Blob){ console.log(Blob.url); } );

Sample Image Conversion Code for Alfresco

If you have a Filestack Blob object or Filestack URL, then you can use the Filestack REST or Javascript APIs to convert office documents and image files. In the sample code below we "pick" an image file from Alfresco and use the Javascript API convert method to resize the image to 400w by 400h in pixels.

Sample Conversion Code
filepicker.pick( { services: ['ALFRESCO'], mimetype: 'image/*', }, function(pickedBlob){ console.log("Conversion in progress...") filepicker.convert( pickedBlob, { width: 400, height: 400, }, { location: 'S3' }, function(convertedBlob){ console.log("Converted file url: ", convertedBlob.url); console.log("File is stored under your S3: ", convertedBlob.key); filepicker.remove( pickedBlob, function(){ console.log("Removed"); } ); } ); } );

Combining Filestack Functions for Alfresco

Now let's combine these methods and see what you can achieve with Filestack and Alfresco! Here we pick an image from Alfresco, crop and resize it, then save it back into Alfresco.

Sample Multi-Function Code
filepicker.pick( { services: ['ALFRESCO'], mimetype: 'image/*', }, function (Blob) { filepicker.convert( Blob, { width: 300, height: 300, crop_first: true }, function (converted_Blob) { filepicker.exportFile(converted_Blob.url, { services: ['ALFRESCO'], mimetype: Blob.mimetype, suggestedFilename: 'converted_' + Blob.filename }, function (exported_Blob) { console.log('File successfully saved!'); }); }); });

Create your own Alfresco OAuth application to Connect to Filestack:

By default, you do not need to configure anything to start uploading files from Alfresco, Filestack is ready to go out of the box. When a user logs into their Alfresco account from your site, the Filestack company application will show up. You can configure it so that your application shows up instead in order to make a more seamless experience for your customers. So let's get started.

  1. Go to and fill out the registration form to signup.
  2. Once you have completed registration you will end up in the dashboard for your account. Click on applications on the left and then click on the "add application" button.
  3. Give the application a name, and a short decsription and select Other as the platform. On the API Management tab Select Alfresco Public API and agree to the Terms and Conditions. Finally on the auth tab enter the oauth callback URL with type public.
  4. You should now have been granted an API Key. To access the APP Key and the APP Secret click the gear and select edit. Then click on the auth tab. The key and secret are available from the two buttons in the window.
  5. Now go to the Filestack developer portal and enter your App Key and APP Secret for Alfresco and click save.
  6. As an optional step you can choose to request production status under the API management tab in the window that allows you to edit/view your application details. After you request the change, it will show up as pending on the Manage Apps screen.
  7. Next test your app to make sure it works. After agreeing to the authorization request from the application you created, you should be able to connect to Alfresco through your app using Filestack.

Congratulations! You have successfully connected Filestack with Alfresco using oauth.

Alfresco Webhooks for Your Application

Alfresco Webhooks serve the purpose of notifying users about events that occur in relation to their Filestack account. In your developer portal, you can set one or many urls whose purpose is to receive the messages triggered by specific Filestack events.

These are the three event types that will send messages to your webhook url(s) concerning Alfresco:

  • Alfresco File Uploads
  • Alfresco File Exports
  • Alfresco File Conversions

Configuring Alfresco Webhooks

Filestack Webhooks are configured in the developer portal under Credentials > Webhooks. If you enter your url and select "All", then one entry will be made for each type of Filestack Webhook Event, including the ones for Alfresco. To learn more about configuring and receiving webhooks please visit our main webhooks documentation page.

Receiving a Alfresco Webhook Notification

Configuring your server to receive a new webhook is the same as creating any page on your website. If you are using Sinatra, add a new route with the desired URL. In PHP you could create a new .php file on your server. It doesn't need to be complicated. With webhooks, your server is the server receiving the request. You can even use an external service such as RequestBin as shown in the screenshot above.

Webhook data is sent as JSON in the request's body. The full event details are included and can be used directly. The "action" in the JSON is the type of Filestack event that happened, be it a file being uploaded, or simply the Filestack dialog opening.

Filestack will retry sending a webhook 3 times if the first attempt fails. The second attempt to deliver a webhook happens 5 minutes after the first attempt, the third attempt happens after 1 hour, and the final attempt to deliver a webhook happens 12 hours after the first attempt.

Note that for file uploads, both symlinks and files copied with pickAndStore, the "client" field shows the service used.

For conversions, the "provider" shows where the file resides. If the file was stored to Filestack's storage, the provider will be "internal", otherwise it could be "amazon" if the original was stored to S3, or one of the cloud drives Filestack connects to, such as "Alfresco" if the link to the file was a symlink.

The following are examples of what the Alfresco specific webhook messages include and look like:

  1. File Upload (symlink):

  2. {

  3. File Upload (with store):

  4. {

  5. File Export (save to):

  6. {
      "action": "fp.export",
      "timestamp": 1444257665,
      "id": 142447,
        "source": "",
        "client": "Alfresco",
        "filename": "newFiletest.jpg",
        "created": ""

  7. File Conversion:

  8. {