我目前正在评估ImageFlow服务器(https://github.com/imazen/imageflow-dotnet-server),以确定它是否能满足我正在从事的项目的需要。通过这些文档,我能够使用以下方法将ImageFlow服务器连接到Azure存储:
public void ConfigureServices(IServiceCollection services)
{
services.AddImageflowAzureBlobService(
new AzureBlobServiceOptions("[MY CONNECTION STRING TO AZURE STORAGE]",
new BlobClientOptions())
.MapPrefix("/azure", "[CONTAINER No. 1]"));
}这是没有问题的工作,我可以看到图像如预期。但是,当前的项目需求要求每个用户都有一个唯一的容器,这使得上面的实现不可能实现。
在发出请求时,是否存在将容器名称与文件名一起传递的方法?类似于:‘/azure/容器/Image.jpg?W=250’
发布于 2021-01-20 04:58:36
在这里,我们有一个示例提供程序可以做到这一点:https://github.com/imazen/imageflow-dotnet-server/blob/main/examples/Imageflow.Server.Example/CustomBlobService.cs
// Custom blob services can do whatever you need. See CustomBlobService.cs in src/Imageflow.Service.Example
services.AddImageflowCustomBlobService(new CustomBlobServiceOptions()
{
Prefix = "/custom_blobs/",
IgnorePrefixCase = true,
ConnectionString = "UseDevelopmentStorage=true;",
// Only allow 'my_container' to be accessed. /custom_blobs/my_container/key.jpg would be an example path.
ContainerKeyFilterFunction = (container, key) =>
container == "my_container" ? Tuple.Create(container, key) : null
});https://stackoverflow.com/questions/65803261
复制相似问题