Articles in this section

How to Achieve Folder Upload in Angular File Manager Component?

This article explains how to achieve folder upload in angular file manager component.

Follow these steps to enable folder upload in the Angular File Manager component using an external drag-and-drop action:

Step 1: Implement the File Manager Component

  • Begin by setting up the File Manager component in your Angular application. Follow the Getting Started documentation to install the necessary dependencies and configure the File Manager setup.

Step 2: Enable Folder Upload through External Drag and Drop

<ejs-filemanager
   id="file"
   #fileObj
   [ajaxSettings]="ajaxSettings"
   [uploadSettings]="uploadSettings" 
></ejs-filemanager> 
import { FileManagerComponent, FileManagerModule } from '@syncfusion/ej2-angular-filemanager';
....
export class AppComponent {
 @ViewChild('fileObj')
 public fileObj: FileManagerComponent;
 public ajaxSettings: object;
 public uploadSettings?: object;
 public hostUrl: string = 'https://ej2-aspcore-service.azurewebsites.net/';
 public ngOnInit(): void {
   this.ajaxSettings = {
     url: this.hostUrl + 'api/FileManager/FileOperations',
     getImageUrl: this.hostUrl + 'api/FileManager/GetImage',
     uploadUrl: this.hostUrl + 'api/FileManager/Upload',
     downloadUrl: this.hostUrl + 'api/FileManager/Download',
   };
   // Enable folder upload via drag and drop
   this.uploadSettings = { directoryUpload: true };
 }
} 

Refer to the working sample for additional details and implementation: FileManager-FolderUpload

See Also:

Conclusion

We hope you enjoyed learning how to achieve folder upload in the Angular File Manager Component.

You can refer to our Angular File Manager feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Angular File Manager example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied