How to increase upload file size in FileManager
Increase the upload file size in FileManager component
Problem dDescription:
In the FileManager component, you can upload the files with default file size 30mb (default size). For example, minimum file size is 0 and maximum file size can be up to 30000000 bytes for uploading a file in the File Manager component. In FileManager, if weyou upload a file with size that exceeds 30000000 bytes, then it will not get uploaded to the target directory and, it will throw an exception message.
Solution dDescription:
You can change the upload file size by using the uploadSettings property of file manager component. Using this property, you can set the maxFileSize and minFileSize. Size should be set in bytes.
Code snippet:
<ejs-filemanager id='overview' [ajaxSettings]='ajaxSettings' [view]='view' [uploadSettings]="uploadSettings"> </ejs-filemanager> App.component.ts public ngOnInit(): void { //Max file size is 500Mb this.uploadSettings ={minFileSize: 0, maxFileSize: 5e+8 } }
Sample Link:
By default, we have prevented the upload settings in online service. So, you have to use the local service to check the upload functionality in File Manager.
Local Service link: https://github.com/SyncfusionExamples/ej2-aspcore-file-provider
Sample link: https://stackblitz.com/edit/angular-erezuh-ciftyp?file=app.component.ts
Step to run the service:
- Clone or download the service URL in Visual Studio.
- Run the service and copy the service URL link.
- Paste the service URL link in FileManager sample.
public hostUrl: string = 'HostURL';
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' }; } |
Conclusion