Esempio n. 1
0
        public void CopyFile(string fromVirtualPath, string destinationVirtualPath)
        {
            MongoGridFS mongoGridFs = GetGridFS();

            string fixedDestinationPath = FixPath(destinationVirtualPath);

            mongoGridFs.CopyTo(FixPath(fromVirtualPath), fixedDestinationPath);

            MongoGridFSFileInfo fileInfo = mongoGridFs.FindOne(fixedDestinationPath);

            mongoGridFs.SetMetadata(fileInfo, CreateMetadata(fixedDestinationPath, false));

            if (FileCopied != null)
            {
                FileCopied.Invoke(this, new FileEventArgs(destinationVirtualPath, fromVirtualPath));
            }
        }