Example #1
0
        /// <summary>
        /// Uploads a screenshot to the target location on the currently
        /// configured server.
        /// </summary>
        /// <param name="stream">The file to upload.</param>
        /// <param name="target">The path on the server to upload to.</param>
        /// <returns>True if the upload succeeded, false otherwise.</returns>
        /// <exception cref="Superscrot.ConnectionFailedException">
        /// Connectioned to the server failed.
        /// </exception>
        public override bool Upload(Stream stream, ref string target)
        {
            EnsureConnection();

            if (!client.DirectoryExists(Path.GetDirectoryName(target)))
            {
                client.CreateDirectory(Path.GetDirectoryName(target));
            }

            return(client.Upload(stream, target));
        }