marclundgren
7/20/2014 - 8:37 PM

My App Upload Folder example

My App Upload Folder example

// add Liferay Upload UI to your App

AUI().use('my-app', 'liferay-upload-base', function(A) {
  var app = new Liferay.MyApp(),
    uploadConfig = app.get('uploadConfig'),

    // instanciate Upload
    upload = new Liferay.Upload(uploadConfig);

  // add folder upload capability
  if (A.UA.webkit) {
    upload.plug(Liferay.UploadFolders);
  }
  
  // add upload UI to your app
  app.set('upload', upload);
});