我想将内存流中的文件上传到Amazon S3服务器。
以下是代码:
public static bool memUploadFile(AmazonS3 client, MemoryStream memFile, string toPath)
{
try
{
Amazon.S3.Transfer.TransferUtility tranUtility = new Amazon.S3.Transfer.TransferUtility(client);
tranUtility.Upload(filePath, toPath.Replace("\\", "/"));
return true;
}
catch (Exception ex)
{
return false;
}
}
然后错误消息指出:
“Amazon.S3.Transfer.TransferUtility.Upload(string,string)的最佳重载方法匹配存在一些无效的参数”。