Пример #1
0
        public bool Upload(string path, FileInfo srcFile, bool? indexZip = null)
        {
            if (!srcFile.Exists) throw new FileNotFoundException("Src file is not accessible", srcFile.ToString());

            DateTime mTime = srcFile.LastWriteTime;
            byte[] checksum = null;
            Stream stream;
            using (stream = new BufferedStream(srcFile.OpenRead(), 1024*1024))
            {
                checksum = stream.ComputeHash(NetstorageCMSv35Signer.HashType.SHA256.Checksum);
            }

            stream = srcFile.OpenRead();
            long size = srcFile.Length;

            return this.Upload(path, stream, mTime, size, sha256Checksum: checksum, indexZip: indexZip);
        }