I am encoding an MVC5 Internet application and would like to help upload a file from my own file system to Azure Blob.
Here is my upload function in Azure:
public void UploadFileToBlobStorage(string containerName, string blockBlogName, string fileName) {
Here is my function to download the test file:
public void UploadTestFile(string localFileName) { string containerName = "TestContainer"; string blockBlogName = "Test.txt"; AzureService azureService = new AzureService(); azureService.UploadFileToBlobStorage(containerName, blockBlogName, localFileName); }
I'm not sure how to call the UploadTestFile () function from MVC View, where the user can navigate to the file being uploaded.
Do I need to use Ajax, or can I just upload the file by calling a method from the MVC view? Can I please help with this?
Thanks in advance
source share