Demir Karic
Demir Karic

Reputation: 147

C# Ftp Error (552) Exceeded storage allocation

I have this code for uploading images on my FTP Server:

FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create("ftp://domain.com/" + "393174" + ".jpg");
                ftp.Credentials = new NetworkCredential("[email protected]", "password");

                ftp.KeepAlive = true;
                ftp.UseBinary = true;
                ftp.Method = WebRequestMethods.Ftp.UploadFile;

                FileStream fs = File.OpenRead(@"location" + "393174" + ".jpg");
                byte[] buffer = new byte[fs.Length];
                fs.Read(buffer, 0, buffer.Length);
                fs.Close();

                Stream ftpstream = ftp.GetRequestStream();
                ftpstream.Write(buffer, 0, buffer.Length);
                ftpstream.Close();

For some reason I get Error (552) Exceeded storage allocation: System.Net.WebException.

I tried with new ftp account on different location but same error. I checked FTP Quota is on Unlimited.

The remote server returned an error: (552) Exceeded storage allocation (for current directory or data set). at System.Net.FtpWebRequest.SyncRequestCallback(Object obj) at System.Net.FtpWebRequest.RequestCallback(Object obj) at System.Net.CommandStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.Stream.Dispose() at System.Net.ConnectionPool.Destroy(PooledStream pooledStream) at System.Net.ConnectionPool.PutConnection(PooledStream pooledStream, Object owningObject, Int32 creationTimeout, Boolean canReuse) at System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage) at System.Net.FtpWebRequest.GetRequestStream() at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\Demir\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs:line 38

Upvotes: 2

Views: 2305

Answers (1)

mybirthname
mybirthname

Reputation: 18127

Pretty much not enough space on the disk, this is the meaning of the error.

Source

The 552 error code is coming directly from the remote FTP server. There is not enough disk space available to you on the remote FTP server. The most common cause for this error is that the limited disk space allocated for your individual FTP account is already in use.

Another article

A 552 reply code may be sent in response to any command requiring the server to store received information locally. It is a permanent negative reply, which means the client is discouraged from sending the command again since the server will respond with the same reply code. It usually indicates that the logged in user has exceeded the storage space allocated to their user account by the administrator.

Upvotes: 2

Related Questions