【问题标题】:Azure Logic App - Save ImageDataURI as image in Azure StorageAzure 逻辑应用 - 将 ImageDataURI 保存为 Azure 存储中的图像
【发布时间】:2021-03-24 01:43:20
【问题描述】:

我正在尝试使用 Azure 逻辑应用将 Web 应用中的图像作为 jpeg 保存在 Azure Blob 存储中。我的 Web 应用允许用户从他们的设备中选择图像,然后将其作为 imageDataUri 发送到使用 Create Blob 操作的 HTTP 触发器逻辑应用。

以下是图像数据 URI 的创建方式:

imageDataUri = $"data:{format};base64,{Convert.ToBase64String(memoryStream.ToArray())}";

文件将成功保存,但不是正确的图像。

如何使用 Azure 逻辑应用中的 imageDataUri 将其保存为 blob 存储中格式正确的 jpeg?

【问题讨论】:

    标签: azure-storage azure-blob-storage azure-logic-apps blazor-webassembly


    【解决方案1】:

    想通了,逻辑应用代码视图如下:

    "Create_blob": {
                "inputs": {
                    "body": "@dataUriToBinary(triggerBody()?['imagedatauri'])",
                    "headers": {
                        "Content-Type": "image/jpeg"
                    },
    

    【讨论】:

      猜你喜欢
      • 2019-01-14
      • 2015-10-10
      • 1970-01-01
      • 2023-03-29
      • 2016-11-18
      • 2017-12-13
      • 1970-01-01
      • 2019-05-15
      • 1970-01-01
      相关资源
      最近更新 更多