Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got Error while copying large size file(300MB or more) from one server to another using FTP
here is my code
C#
public void FTPUpload(string p_FilePath, string p_FTPServer, string p_Username, string p_Password)
        {
            try
            {
                //Reading file into a byte array
                byte[] file = null;
                file = System.IO.File.ReadAllBytes(p_FilePath);

                //Request
                System.Net.FtpWebRequest req = null;
                req = (System.Net.FtpWebRequest)System.Net.WebRequest.Create(p_FTPServer);
                req.KeepAlive = false;
                req.UsePassive = true;
                req.UseBinary = true;
                req.Proxy = null;

                //timeout set to 40 minute need to change
                req.Timeout = 2400000;
                req.ReadWriteTimeout = 2400000;

                //Credentials
                System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(p_Username, p_Password);
                req.Credentials = credentials;

                //Request Method
                req.Method = System.Net.WebRequestMethods.Ftp.UploadFile;

                //uploading file onto FTP server
                System.IO.Stream stream = null;

                stream = req.GetRequestStream();
                stream.Write(file, 0, file.Length);
                stream.Close();

            }
            catch (Exception ex)
            {
                Util.WriteToErrorLogFile(ex, "Error:017", "From FTP File laod of Service");
            }
        }

Error shows this
The remote server returned an error: (550) File unavailable (e.g., file not found, no access).
Posted
Updated 18-Jul-13 3:51am
v2
Comments
[no name] 18-Jul-13 9:30am    
http://social.msdn.microsoft.com/Forums/en-US/610372c7-b877-403f-b6a1-56b4df79ade7/the-remote-server-returned-an-error-550-file-unavailable-durring-an-ftp-download-on-vista

1 solution

check your server limitation...many server does not support to upload big size file
 
Share this answer
 
Comments
ALTT 19-Jul-13 2:39am    
how to check? where these setting Reside?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900