如何将文件从 Deluge 上传到 Catalyst Filestore?

问题描述 投票:0回答:1

我有一个创建者应用程序,用户可以在其中上传简历以申请工作。我需要将该应用程序存储在 Catalyst FileStore 中,所以有人可以与我分享任何使用 Deluge 上传文件到 Catalyst Filestore 的代码片段吗?

catalystbyzoho zohocatalyst catalystcloudscale
1个回答
0
投票

要从 Deluge 函数上传文件,您需要从 Deluge 函数获取文件并使用 Catalyst 文件存储 uploadFile API 发送文件。您可以使用下面的示例代码片段获取必要的信息以及如何使用 Deluge 中的上传文件 API 上传文件

//create the headers for the Catalyst API's
headerMap = Map();
headerMap.put("Authorization","Zoho-oauthtoken {access_token}"); // create token with the required scope ZohoCatalyst.files.CREATE
headerMap.put("Environment","Development");

//get file from a source
getFile = invokeurl
[
    url :"https://img.zohostatic.com/catalyst/img/Face_Sample_Image-2-a4fa6f6a69.jpg"
    type :GET
];
info getFile;

// upload the file to the catalyst filestore
filelist = List();
filelist.add({"paramName":"code","content":getFile});
filelist.add({"paramName":"file_name","content":"Face_Sample.jpg","stringPart":"true"});

uploadFile = invokeurl
[
url :"https://api.catalyst.zoho.com/baas/v1/project/{project_id}/folder/{folder_id}/file"
    type :POST
    headers:headerMap
    files:filelist
];
info uploadFile;


return "";

要了解有关 Catalyst API 的更多信息,您可以关注此处的官方帮助文档。

© www.soinside.com 2019 - 2024. All rights reserved.