gpt4 book ai didi

c# - Amazon.S3.IO S3目录信息

转载 作者:太空宇宙 更新时间:2023-11-03 21:53:34 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How to upload files to Amazon S3 (official SDK) that are larger than 5 MB (approx)?

我尝试使用 Amazon.S3.IO API。如果我写 10mb 就没有问题。如果我写 21mb,我会得到一个异常(exception):

The request was aborted: The request was canceled.

StackTRace:
at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting) at System.Net.ConnectStream.System.Net.ICloseEx.CloseEx(CloseExState closeState) at System.Net.ConnectStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.Stream.Dispose() at Amazon.S3.AmazonS3Client.getRequestStreamCallback[T](IAsyncResult result) at Amazon.S3.AmazonS3Client.endOperation[T](IAsyncResult result) at Amazon.S3.AmazonS3Client.EndPutObject(IAsyncResult asyncResult) at Amazon.S3.AmazonS3Client.PutObject(PutObjectRequest request) at Amazon.S3.IO.S3FileStream.Flush(Boolean flushToS3) at Amazon.S3.IO.S3FileStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.StreamWriter.Dispose(Boolean disposing) at System.IO.TextWriter.Dispose() at S3FileSystem_Sample.Program.createFile(S3DirectoryInfo rootDirectory, String filename) in c:\Program Files (x86)\AWS SDK for .NET\Samples\S3FileSystem_Sample \S3FileSystem_Sample\Program.cs:line 106 at S3FileSystem_Sample.Program.Main(String[] args) in c:\Program Files (x86)\AWS SDK for .NET\Samples\S3FileSystem_Sample\S3FileSystem_Sample\Program.cs:line 59 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

static void createFile(S3DirectoryInfo rootDirectory, string filename)
{

// Creates a file at the root of the bucket.
S3FileInfo readme = rootDirectory.GetFile(filename);
char[] buffer = new char[buffersize];
fillBuffer(buffer);

using (StreamWriter writer = new StreamWriter(readme.OpenWrite()))
{

writer.Write(buffer);

}
}

我可以设置超时吗?

Click herehere更多相关问题。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com