public void UploadResume(string localDirectory, string localFilename, string remoteDirectory, string remoteFileName)
        {
            _abort = false;
            FileInfo      fi             = new FileInfo(Path.Combine(localDirectory, localFilename));
            long          remoteFileSize = 0;
            FtpWebRequest request        = null;
            long          totalBytesSend = 0;

            request             = WebRequest.Create(new Uri("ftp://" + _host + ":" + Port + "/" + remoteDirectory + "/" + remoteFileName)) as FtpWebRequest;
            request.Credentials = new NetworkCredential(UserName, Password);
            request.Timeout     = TimeOut;
            request.UsePassive  = UsePassive;
            request.KeepAlive   = KeepAlive;
            try
            {
                if (this.FileExists(remoteDirectory, remoteFileName, out remoteFileSize))
                {
                    request.Method = WebRequestMethods.Ftp.AppendFile;
                }
                else
                {
                    WebException webException;
                    if (!this.DirectoryExits(remoteDirectory, out webException))
                    {
                        var directoryCreated = this.CreateDirectory(remoteDirectory, out webException);
                    }//if
                    request.Method = WebRequestMethods.Ftp.UploadFile;
                }
                request.ContentLength = fi.Length - remoteFileSize;
                request.UsePassive    = true;

                using (Stream requestStream = request.GetRequestStream())
                {
                    using (FileStream logFileStream = new FileStream(Path.Combine(localDirectory, localFilename), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                    {
                        StreamReader fs = new StreamReader(logFileStream);

                        fs.BaseStream.Seek(remoteFileSize, SeekOrigin.Begin);
                        byte[] buffer    = new byte[BUFFER_SIZE];
                        int    readBytes = 0;
                        do
                        {
                            readBytes = fs.BaseStream.Read(buffer, 0, BUFFER_SIZE);
                            requestStream.Write(buffer, 0, readBytes);
                            if (UploadProgressChanged != null && !_abort)
                            {
                                UploadProgressChanged(this, new UploadProgressChangedLibArgs(fs.BaseStream.Position, fs.BaseStream.Length));
                            }
                            //System.Threading.Thread.Sleep(500);
                        } while (readBytes != 0 && !_abort);
                        //_fileStreams.Remove( fs );
                        requestStream.Close();
                        totalBytesSend = fs.BaseStream.Length;
                        fs.Close();
                        logFileStream.Close();
                        Thread.Sleep(100);
                    } //using
                }     //using
                //Console.WriteLine( "Done" );
                if (UploadFileCompleted != null && !_abort)
                {
                    var uploadFileCompleteArgs = new UploadFileCompletedEventLibArgs(totalBytesSend, TransmissionState.Success);
                    UploadFileCompleted(this, uploadFileCompleteArgs);
                } //if
            }     //try
            catch (WebException webException)
            {
                if (UploadFileCompleted != null && !_abort)
                {
                    UploadFileCompleted(this, new UploadFileCompletedEventLibArgs(totalBytesSend, TransmissionState.Failed, webException));
                } //if
            }     //catch
            catch (Exception exp)
            {
                if (UploadFileCompleted != null && !_abort)
                {
                    UploadFileCompleted(this, new UploadFileCompletedEventLibArgs(totalBytesSend, TransmissionState.Failed, exp));
                } //if
            }     //catch
        }         //method
        public void Upload(string localFullFileName, string remoteDirectory, string remoteFileName)
        {
            _abort = false;
            FtpWebRequest request        = null;
            long          totalBytesSend = 0;

            try
            {
                Uri uri = null;
                if (remoteDirectory.Contains("ftp://"))
                {
                    uri = new Uri(remoteDirectory + "/" + remoteFileName);
                }
                else
                {
                    uri = new Uri("ftp://" + _host + ":" + Port + "/" + remoteDirectory + "/" + remoteFileName);
                }


                request             = WebRequest.Create(uri) as FtpWebRequest;
                request.Credentials = new NetworkCredential(UserName, Password);
                request.UsePassive  = UsePassive;
                request.Timeout     = TimeOut;
                request.KeepAlive   = KeepAlive;
                WebException webException;
                Debug.WriteLine("proofing directory exists");
                if (!this.DirectoryExits(remoteDirectory, out webException))
                {
                    this.CreateDirectoryRecursive(remoteDirectory, out webException);
                }//if
                request.Method = WebRequestMethods.Ftp.UploadFile;

                //request.ContentLength = fi.Length - remoteFileSize;

                Debug.WriteLine("starting upload");
                using (Stream requestStream = request.GetRequestStream())
                {
                    using (FileStream fs = File.Open(localFullFileName, FileMode.Open))
                    {
                        fs.Seek(0, SeekOrigin.Begin);
                        byte[] buffer    = new byte[BUFFER_SIZE];
                        int    readBytes = 0;
                        do
                        {
                            readBytes = fs.Read(buffer, 0, BUFFER_SIZE);
                            requestStream.Write(buffer, 0, readBytes);
                            if (UploadProgressChanged != null && !_abort)
                            {
                                UploadProgressChanged(this, new UploadProgressChangedLibArgs(fs.Position, fs.Length));
                            }
                            //System.Threading.Thread.Sleep(500);
                        } while (readBytes != 0 && !_abort);
                        totalBytesSend = fs.Length;
                    } //using
                }     //using
                if (UploadFileCompleted != null && !_abort)
                {
                    var uploadFileCompleteArgs = new UploadFileCompletedEventLibArgs(totalBytesSend, TransmissionState.Success);
                    UploadFileCompleted(this, uploadFileCompleteArgs);
                } //if
            }     //try
            catch (WebException webException)
            {
                if (UploadFileCompleted != null && !_abort)
                {
                    UploadFileCompleted(this, new UploadFileCompletedEventLibArgs(totalBytesSend, TransmissionState.Failed, webException));
                } //if
            }     //catch
            catch (Exception exp)
            {
                var webException = exp as WebException;
                if (UploadFileCompleted != null && !_abort)
                {
                    UploadFileCompleted(this, new UploadFileCompletedEventLibArgs(totalBytesSend, TransmissionState.Failed, webException));
                } //if
            }     //catch
        }         // method