私は、ファイルをアップロードするためにバックグラウンドワーカーを使用しているWindowsフォームアプリケーションを持っています。 209
ファイルを正常にアップロードした後は、サイズが7.8kbのファイルでエラーが発生しました。そのサイズはWhile Processing Img1.jpg Unable to write data to the transport connection. An existing connection was forcibly closed by the remote host
です。Ftpアップロードで例外が発生しましたトランスポート接続にデータを書き込めません。既存の接続はリモートホストによって強制的に閉じられました
string uri1;
ftpInfoUpload = LoadHostedSiteData(hs);
ftpInfoUpload[5] = imgRow["Filename"].ToString();
uri1 = String.Format("ftp://{0}/{1}/images/{2}", ftpInfoUpload[1], ftpInfoUpload[2], ftpInfoUpload[5]);
requestUpload = (FtpWebRequest)WebRequest.Create(uri1);
requestUpload.UsePassive = false;
requestUpload.UseBinary = true;
requestUpload.Method = WebRequestMethods.Ftp.UploadFile;
requestUpload.Credentials = new NetworkCredential(ftpInfoUpload[3], ftpInfoUpload[4]);
requestUpload.ContentLength = memStream.Length;
byte[] buff = new byte[bufferSize];
int contentLen;
// Stream to which the file to be upload is written
Stream strm = requestUpload.GetRequestStream();
memStream.Seek(0, SeekOrigin.Begin);
contentLen = memStream.Read(buff, 0, bufferSize);
// Till Stream content ends
while (contentLen > 0)
{
// Write Content from the file stream to the FTP Upload Stream
strm.Write(buff, 0, contentLen);
contentLen = memStream.Read(buff, 0, bufferSize);
}
//Close the file stream and the Request Stream
strm.Close();
strm.Dispose();
ftpStream.Close();
memStream.Close();
//responseUpload.Close();
responseDownload.Close();
アイデアは何が起こっていますか?
FTPサーバーのクォータを超過したため、接続が中断された可能性があります。サポートについては、サーバー管理者にお問い合わせください。 –
@HansPassantファイル数のクォータ?サーバーにはユーザーが転送できるファイル数の割り当てがありますか? – PUG
おそらくありません。むしろ、あなたがアップロードしたファイルのサイズに応じて発生したトラフィックの総量に対するクォータまたは単純な接続のリセット – yas4891