Hi,
I am currently trying to get the following working: https://ej2.syncfusion.com/documentation/file-manager/file-system-provider#aspnet-core-azure-cloud-file-system-provider but to no avail.
I think I have followed the right steps to configure the Azure storage account name, account key, and container name but I am not able to make the backend ASP.NET Core app respond with a list of the files in my Azure storage container.
I have cloned the repo and build the solution in Visual Studio. I have tried to run it in Debug mode but it responds with: 415 Unsupported Media Type when I issue a GET request to http://localhost:62869/api/AzureProvider/AzureFileOperations
In
Can you help please as this is impacting development timelines?
Am I correctly setting blobPath and filePath:
I've tried multiple attempts:
blobPath = "https://lttestdocuments.blob.core.windows.net/data";
filePath = "https://lttestdocuments.blob.core.windows.net/data/";
Hi,
It seems to work if i pick one folder inside my container and append to the filePath variable:
filePath = "https://lttestdocuments.blob.core.windows.net/data/folder_name";
But I am not able to set the filePath to point to the root of the container '/'
Hi Fatos,
Greetings from Syncfusion support.
Based on the shared details, we have validated your reported query in the ASP.NET Core FileManager component. We suspect that the reported issue occurs on your end due to an incorrect path in the Azure service provider. You can resolve the issue by specifying the correct path in the AzureProviderController.cs file. You need to specify the proper blobPath, which is the container path in Azure blob storage, and the Files location path in the filePath where you need to include the files and folders you want to view in the ASP.NET Core FileManager component. Additionally, you need to register the Azure storage by passing details like account name, password, and blob name to the RegisterAzure method in the AzureProviderController.cs file.
For example, we have created a files container in the Azure blob storage. Inside that container, we have created a new folder, Files, which includes all files and folders that need to be viewed in the FileManager.
Refer to the below code snippets.
[AzureProviderController.cs]
|
namespace EJ2AzureASPCoreFileProvider.Controllers { [Route("api/[controller]")] [EnableCors("AllowAllOrigins")] public class AzureProviderController : Controller { public AzureFileProvider operation; public string blobPath { get; set; } public string filePath { get; set; } public AzureProviderController(IWebHostEnvironment hostingEnvironment) { this.operation = new AzureFileProvider(); blobPath = "https://azure_service_account.blob.core.windows.net/files/"; filePath = "https://azure_service_account.blob.core.windows.net/files/Files"; … this.operation.SetBlobContainer(blobPath, filePath); this.operation.RegisterAzure("<--accountName-->", "<--accountKey-->", "<--blobName-->"); } … }
} |
For your reference, we have attached the documentation, Azure provider GitHub repo, and runnable demo sample.
Documentation: https://ej2.syncfusion.com/documentation/file-manager/file-system-provider#aspnet-core-azure-cloud-file-system-provider
Azure provider: https://github.com/SyncfusionExamples/azure-aspcore-file-provider/tree/master
Demo: https://ej2.syncfusion.com/demos/#/material3/file-manager/azure-service.html
Try out the shared details and let us know if you need any further assistance.
Regards,
Prasanth Madhaiyan.
Hi I have the same problem my previous project the files and folders are stored in the root of the container not in a folder so the what should i put on the filepath if i want all that is in the container.
Hi Thabang,
Based on the information provided, it seems that you want to set the filePath without using any container. We would like to inform you that we have performed the FileOperations using our Azure file provider, which is based on the file path. Additionally, we have a container path (blobPath) for Azure blob storage and the root location path (filePath) for viewing files and folders in the FileManager component. We have clearly explained this behavior in our previous update.
For your convenience, we have attached the documentation and the Azure provider GitHub repository for your reference.
Documentation: https://ej2.syncfusion.com/documentation/file-manager/file-system-provider#aspnet-core-azure-cloud-file-system-provider
Please review the information provided and let us know if you require any further assistance.
Regards,
Leo Lavanya Dhanaraj