Example #1
0
        protected virtual void SaveOriginal(FilesItem filesItem, UploadFileInfo uploadFile)
        {
            //throw new Exception("SaveOriginal");
            //string path = Path.Combine(SavePath, Guid.NewGuid().ToString() + "_" + Original + uploadFile.Extension);
            var    no   = Uploads.Files.Count + 1;
            string path = Path.Combine(SavePath, $"{no}_{Original}{uploadFile.Extension}");

            using (var newStream = new FileStream(UploadSettings.WebRootPath + path, FileMode.OpenOrCreate))
            {
                uploadFile.FileStream.CopyTo(newStream);
            }
            filesItem.O = new OriginalItem
            {
                Length   = uploadFile.Length,
                Name     = uploadFile.FileName,
                FullPath = $"{UploadSettings.UriPath.TrimEnd('/')}/{path.Replace("\\", "/").TrimStart('/')}",
                UriPath  = UploadSettings.UriPath,
                Path     = path,
                Suff     = uploadFile.Extension,
                No       = Uploads.Files.Count
            };
        }
Example #2
0
 protected abstract void SaveAddtional(FilesItem filesItem, UploadFileInfo uploadFile);