Describe the bug
This is a question. Is there a way to use uploadBrowserData() method in @azure/storageblob to upload directly to a folder inside a blob?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
either folder can be added in a blob client URL or options can be set in BlockBlobParallelUploadOptions class in the uploadBrowserData() method.
Screenshots
Additional context
Who do you mean by a folder inside a blob?
@kktam are you using some path separator for your hierarchy? I suppose you can give your blob a name like path/to/my/blob to achieve the goal?
Who do you mean by
a folder inside a blob?
Yes, I am trying to upload a blob directly to a path already created inside the container using the .net method.
Yes, I am trying to upload a blob directly to a path already created inside the container using the .net method.
@kktam you should be able to do that by naming your blob accordingly.
const blobClient = containerClient.getBlockBlobClient(`folder1/folder2/blob-${id}.txt`);
const res = await blobClient.uploadData(buffer);
console.log(res);
Is there an issue you are hitting?
Yes, I am trying to upload a blob directly to a path already created inside the container using the .net method.
@kktam you should be able to do that by naming your blob accordingly.
const blobClient = containerClient.getBlockBlobClient(`folder1/folder2/blob-${id}.txt`); const res = await blobClient.uploadData(buffer); console.log(res);Is there an issue you are hitting?
@jeremymeng the code snippet is correct. I am now able to load a file directly inside a folder now. Thanks.
@kktam Glad to know that it is working for you! I am closing this. Please open new issues if you have any other feedback.
Most helpful comment
@kktam you should be able to do that by naming your blob accordingly.
Is there an issue you are hitting?