private void APPE(string argsText) { if(m_SessionRejected){ WriteLine("500 Bad sequence of commands: Session rejected."); return; } if(!this.IsAuthenticated){ WriteLine("530 Please authenticate firtst !"); return; } if(string.IsNullOrEmpty(argsText)){ WriteLine("501 Invalid file name."); } /* This command causes the server-DTP to accept the data transferred via the data connection and to store the data in a file at the server site. If the file specified in the pathname exists at the server site, then the data shall be appended to that file; otherwise the file specified in the pathname shall be created at the server site. */ FTP_e_Appe eArgs = new FTP_e_Appe(argsText); OnAppe(eArgs); // Opearation failed. if(eArgs.Error != null){ foreach(FTP_t_ReplyLine reply in eArgs.Error){ WriteLine(reply.ToString()); } } // Opearation succeeded. else{ if(eArgs.FileStream == null){ WriteLine("500 Internal server error: File stream not provided by server."); return; } m_pDataConnection = new DataConnection(this,eArgs.FileStream,true); m_pDataConnection.Start(); } }
/// <summary> /// Raises <b>Appe</b> event. /// </summary> /// <param name="e">Event data.</param> private void OnAppe(FTP_e_Appe e) { if(this.Appe != null){ this.Appe(this,e); } }