Пример #1
0
        /// <summary>
        /// Copy a file to the FTP destination
        /// </summary>
        /// <param name="from">The path from which to copy the file</param>
        /// <param name="to">The file to which to copy the file</param>
        /// <param name="overWrite">Ignored- files are always overwritten on the FTP server</param>
        /// <returns>true if the copy succeeded, otherwise false</returns>
        public override bool CopyFile(string from, string to, bool overWrite)
        {
            // Validate that the file transferred, throw an exception if necessary
            // Non fatal errors will allow putFile = false to pass through without
            // throwing an exception.  That will pass that CopyFile failed up
            // up the chain, allowing any retry logic to execute.

            // NOTE: This should respect the bool overWrite.  Right now, it just
            // blows over the top
            return(ValidateFileTransfer(WinInet.FtpPutFile(
                                            m_hFtp,
                                            from,
                                            to,
                                            0, // FTP Flags (none necessary)
                                            0  // Application Context
                                            )));
        }