Share URL of files

Eduardo Gomez 3,416 Reputation points
2023-01-26T17:30:56.0066667+00:00

Ok so I was trying to implement the windows ten share UI in WPF, and because is a pain and I need it to be backward compatible with Win 7. I am trying another approach

I create a new Container in azure

User's image

The new container name in "share"

And here is the URI

User's image

So, I am using this method to upload it

 public async Task<Uri> UploadToAzureBlobStorage(string FilePath) {

            ContainerClient = new BlobContainerClient(ConectionString,
                ConstantsHelpers.AZURE_DOWNLOAD_SHARE_DOCUMENTS);

            var blob = ContainerClient.GetBlobClient(Path.GetFileName(FilePath));
            await blob.UploadAsync(FilePath, true);

            return new Uri($"{ConstantsHelpers.AZURE_DOWNLOAD_SHARE_DOCUMENTS}");
        }

My AZURE_SHARE is the URL

        public const string AZURE_DOWNLOAD_SHARE_DOCUMENTS = "https://transcribemedocs.blob.core.windows.net/share";

And I use it like this

  var uri = await azureStorage.UploadToAzureBlobStorage(file.FilePath);

But I get this error

Azure.RequestFailedException: 'The specifed resource name contains invalid characters.

RequestId:d42d17f4-801e-0058-1ea9-31d585000000

Time:2023-01-26T17:13:37.0752800Z

Status: 400 (The specifed resource name contains invalid characters.)

ErrorCode: InvalidResourceName

Content:

<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidResourceName</Code><Message>The specifed resource name contains invalid characters.

RequestId:d42d17f4-801e-0058-1ea9-31d585000000

Time:2023-01-26T17:13:37.0752800Z</Message></Error>

Headers:

Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0

x-ms-request-id: d42d17f4-801e-0058-1ea9-31d585000000

x-ms-client-request-id: 2f18698f-d34e-4a9e-bef8-23af87d7c775

x-ms-version: 2021-10-04

x-ms-error-code: InvalidResourceName

Date: Thu, 26 Jan 2023 17:13:36 GMT

Content-Length: 243

Content-Type: application/xml

'

I do not understand, I am able to upload it to my other containers

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,722 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,681 questions
{count} votes

0 additional answers

Sort by: Most helpful