I know that we can upload files to azure blob storage using below:
CloudBlockBlob cloudBlockBlob = fileContainer.GetBlockBlobReference(fileName);
await cloudBlockBlob.UploadFromFileAsync(fileFullPath);
I already created some folders in the container. I tried a few time but the files always uploaded outside the folder.
How do we upload the files into a specific folder in the blob storage?
I guess you have to get the right reference first ( you need to include the fullpath of the file in the GetBlockBlobReference) as in :
CloudBlockBlob cloudBlockBlob = fileContainer.GetBlockBlobReference($"yourfoldername/{fileName}");
One important thing is you DON'T need to create folder, it will automatically create it for you based on your path in the GetBlockBlobReference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With