Hi Mahesh,
Greetings from Sycnfusion support.
Query 1 – Share the Reference.
While uploading the file, you can get the uploaded file details in server side upload operation. You can save the file details as a reference. While navigating to the another folder, read operation (GetFiles() operation) will trigger in the server side. In that operation, you can add the uploaded file in corresponding folder. We have already shared a sample how to override the getFiles() operation in FileManager component. Refer the forum 151112 link.
Additional information: In client side, fileOpen() will trigger on folder navigation. If you want to sent the custom parameter use beforeSend() event.
Query 2 – Upload a file with same name.
We have checked your reported query. Currently, we have not provided support for upload the same file name in SQL File Provider. But we have this support in below file provider.
1. ASP.NET Core File Provider
2. ASP.NET MVC Azure File Provider
You can refer the below links.
Refer the below code snippet for ASP.NET CORE file provider.
else if (action == "keepboth")
{
string newName = fullName;
int index = newName.LastIndexOf(".");
if (index >= 0)
newName = newName.Substring(0, index);
int fileCount = 0;
while (System.IO.File.Exists(newName + (fileCount > 0 ? "(" + fileCount.ToString() + ")" + Path.GetExtension(name) : Path.GetExtension(name)))) { fileCount++; }
newName = newName + (fileCount > 0 ? "(" + fileCount.ToString() + ")" : "") + Path.GetExtension(name);
using (FileStream fs = System.IO.File.Create(newName)) { file.CopyTo(fs); fs.Flush(); }
}
} |
You can try to achieve your requirement based on this reference. In the meanwhile, we will implement this feature in our SQL ASP.NET Core provider and will include it in our February last week patch release which is expected to be released at end of February. Please be patience, until then.
Please, get back to us if you face any issue while implementing this requirement. we will be happy to assist you.
Regards,
Sowmiya.P