Good evening!
I'm trying to use the Upload component and connecting with Azure Blob Storage. I managed to perform every step correctly but when I upload the file it says the path is not correct. I'm using the file.Name as the argument and in debug... he thinks the file is in the project's root. (I've uploaded from my PC Downloads folder)
I need to use the correct argument but I can't figure it out
Here's the code:
<RadzenUpload Accept="document/.pdf" Url="upload/single" Progress="@((args) => OnProgress(args, "Uploading file..."))"/>
void OnProgress(UploadProgressArgs args, string name)
{
this.info = $"% - '{name}' / {args.Loaded} of {args.Total} bytes.";
this.progress = args.Progress;
if (args.Progress == 100)
{
string connectionString = Environment.GetEnvironmentVariable("Azure__Storage__ConnectionString");
string containerName = "hightide";
string blobName = "pitchdecks";
// Get a reference to a container named "sample-container" and then create it
BlobContainerClient container = new BlobContainerClient(connectionString, containerName);
container.CreateIfNotExists();
// Get a reference to a blob named "sample-file" in a container named "sample-container"
BlobClient blob = container.GetBlobClient(blobName);
this.info = $"% - '{"Upload completed!"}' / {args.Loaded} of {args.Total} bytes.";
foreach (var file in args.Files)
{
// Upload local file
blob.Upload(file.Name);
}
}
}