开发者社区 问答 正文

如何使用云函数调用文件存储服务?

如何使用云函数调用文件存储服务?

展开
收起
珍宝珠 2020-02-17 16:45:34 2951 分享 版权
1 条回答
写回答
取消 提交回答
  • 阿里云头部开发者运营小二

    云函数调用示例

    以下代码展示了如何通过云函数上述客户端中上传的图片删除掉。

    module.exports = async (ctx) => {
     ​ // ctx.args 是从客户端传过来的参数
      const res = await ctx.mpserverless.file.deleteFile({ fileUrl: ctx.args.fileUrl });
      return res;
    };
    
    2020-02-17 17:33:39
    赞同 展开评论
问答分类:
问答地址: