从URL下载文件并保存到lamdbda临时文件夹C#

时间:2018-09-20 05:00:39

标签: c# amazon-web-services amazon-s3 aws-lambda

如何保存在lambda temp文件夹中?为了能够从lambda temp文件夹中保存并获取文件。

1 个答案:

答案 0 :(得分:1)

您可以像写入其他任何文件夹一样写入temp文件夹。临时文件夹位于/ tmp

以下是执行此操作的示例代码段

// Example #1: Write an array of strings to a file.
// Create a string array that consists of three lines.
string[] lines = { "First line", "Second line", "Third line" };
// WriteAllLines creates a file, writes a collection of strings to the file,
// and then closes the file.  You do NOT need to call Flush() or Close().
System.IO.File.WriteAllLines(@"/tmp/someText.txt", lines);