power-automate - Microsoft Flow - 解码“文件内容”属性(SharePoint 触发器)
问题描述
我们正在为 Microsoft Flow 构建一个自定义连接器,并希望有人可以帮助澄清 Flow 是如何对以下 SharePoint 触发器中的文件内容属性进行编码的:“创建或修改文件时”
我们可以从发送到我们 EndPoint 的请求中看到:
- 内容类型设置为:“application/json;charset=utf-8”
- JSON 格式正确,包含 File Content 属性的编码字符串
但是,我们找不到成功解码字符串的方法(假设它是 Base64)......错误消息:
“输入不是有效的 Base-64 字符串,因为它包含非 base 64 字符、两个以上的填充字符或填充字符中的非法字符”
任何关于如何正确地将 data = (ASPNet Core 2 API) 转换为字节数组的指导将不胜感激。
非常感谢
解决方案
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);
推荐阅读
- bash - 查找大文件并清空它们
- javascript - 仅在表格全部填写时激活按钮
- reactjs - 如何在开发模式下开始响应服务?
- node.js - npm install 在 docker 容器中需要很长时间
- laravel - 尝试获取响应 json,Laravel 分页缺少元数据和 API 资源链接
- php - Laravel 中的数据模型错误 (SQLSTATE[42S01])
- react-native - 默认情况下,在 ios 中填写密码时获取随机值,并在 react-native 中的 android 中正常工作
- java - 使用套接字连接将 Android 应用程序连接到自动化设备时出现问题
- flutter - Stream transform 和 listen in flutter 有什么区别?何时实施?
- google-cloud-platform - GCP API 是否支持过滤列表对象?