File upload on Cloud and server in WPF

Pratham Jain 281 Reputation points
2023-07-25T13:07:02.8566667+00:00

Hi All, I need to implement a file upload utility in WPF where user will select file(s) from his system and then upload the same to cloud manually. User can upload the selected file(s) to cloud or server. Please advise how to achieve the same ASAP.

Developer technologies Windows Presentation Foundation
{count} votes

1 answer

Sort by: Most helpful
  1. Martin Egli 125 Reputation points
    2023-07-25T15:59:12.2566667+00:00
    public static async Task UploadFromFileAsync(
        BlobContainerClient containerClient,
        string localFilePath)
    {
        string fileName = Path.GetFileName(localFilePath);
        BlobClient blobClient = containerClient.GetBlobClient(fileName);
    
        await blobClient.UploadAsync(localFilePath, true);
    }
    

    Blob

    https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-upload

    Fileshare

    https://learn.microsoft.com/en-us/dotnet/api/overview/azure/storage.files.shares-readme?view=azure-dotnet

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.