首页 > 解决方案 > Microsoft Flow - 解码“文件内容”属性(SharePoint 触发器)

问题描述

我们正在为 Microsoft Flow 构建一个自定义连接器,并希望有人可以帮助澄清 Flow 是如何对以下 SharePoint 触发器中的文件内容属性进行编码的:“创建或修改文件时”

我们可以从发送到我们 EndPoint 的请求中看到:

但是,我们找不到成功解码字符串的方法(假设它是 Base64)......错误消息:

“输入不是有效的 Base-64 字符串,因为它包含非 base 64 字符、两个以上的填充字符或填充字符中的非法字符”

任何关于如何正确地将 data = (ASPNet Core 2 API) 转换为字节数组的指导将不胜感激。

非常感谢

标签: power-automate

解决方案


var DeodedText = "put your encoded text here";
byte[] imageBytes=Convert.FromBase64String(DeodedText);

FileInfo file = new FileInfo("your path /filename.extension");

file.Directory.Create();

File.WriteAllBytes("your path /filename.extension", imageBytes);

推荐阅读