Hi Syncfusion Team,
I was reading some forums such as this https://www.syncfusion.com/feedback/10089/upload-folder-support-in-file-manager-component where you responded that currently is not in your priorities to include upload folder in the syncfusion file manager. We'd like to have that feature in the file manager, however my thinking and wondering is if you have a way to integrate the file manager with the react file upload component https://www.syncfusion.com/react-ui-components/react-file-upload . That would be wonderful as the react file upload component provides a better upload experience than the default uploader in the file manager, and also, it includes upload folder (directory).
Look forward to receiving your response.
Thanks,
David
// uploads the file(s) into a specified path
[Route("Upload")]
public IActionResult Upload(IList<IFormFile> UploadFiles, string action, IFormCollection form)
{
var data = Request.Form["path"];
var path = data.ToString().Replace("/", "\\");
long size = 0;
try
{
foreach (var file in UploadFiles)
{
var filename = ContentDispositionHeaderValue
.Parse(file.ContentDisposition)
.FileName
.Trim('"');
var folders = filename.Split('/');
var uploaderFilePath = this.basePath + "\\" + this.root + path;
// for Directory upload
if (folders.Length > 1)
{
for (var i = 0; i < folders.Length - 1; i++)
{
var newFolder = uploaderFilePath + $@"\{folders[i]}";
Directory.CreateDirectory(newFolder);
uploaderFilePath = newFolder;
filename = folders[i + 1];
}
}
filename = uploaderFilePath + $@"\{filename}";
size += file.Length;
if (!System.IO.File.Exists(filename))
{
using (FileStream fs = System.IO.File.Create(filename))
{
file.CopyTo(fs);
fs.Flush();
}
…
} |
toolbarClick(args) {
if (args.item.text === 'Custom') {
const wrapperEle = select('.e-file-select-wrap button', document);
wrapperEle.click();
}
}
onUploadBegin(args) {
var p = document.getElementById('overview_file').ej2_instances[0].path;
// add addition data as key-value pair.
args.customFormData = [{ path: p }];
}
success() {
this.fileObj.refreshFiles();
}
render() {
return (
<div>
<div className="control-section">
<UploaderComponent
id="UploadFiles"
ref={upload => {
this.uploadObj = upload;
}}
asyncSettings={this.path}
directoryUpload={true}
uploading={(this.onUploadBegin = this.onUploadBegin.bind(this))}
success={(this.success = this.success.bind(this))}
/>
<div id="container">
<FileManagerComponent
id="overview_file"
ref={fileObj => {
this.fileObj = fileObj;
}}
toolbarClick={this.toolbarClick}
…
toolbarSettings={{
items: [
'NewFolder',
'Custom',
'Delete',
'Download',
'Rename',
'SortBy',
'Refresh',
'Selection',
'View',
'Details'
]
…
} |