コード例 #1
0
        private void DeleteTemporalAttachment(TemporalFileReference temporalReference)
        {
            var temporalFolderPath = Configuration.TemporalUploadsPath;
            var temporalFilePath   = Path.Combine(temporalFolderPath, temporalReference.InternalFileName);

            System.IO.File.Delete(temporalFilePath);
        }
コード例 #2
0
        private AttachmentReference GenerateAttachment(object entity, TemporalFileReference temporalReference)
        {
            AttachmentReference result;
            var temporalFolderPath = Configuration.TemporalUploadsPath;
            var temporalFilePath   = Path.Combine(temporalFolderPath, temporalReference.InternalFileName);

            using (var stream = System.IO.File.OpenRead(temporalFilePath))
            {
                result = ExecuteCommand(new SaveAttachment(
                                            entity,
                                            temporalReference.OriginalFileName,
                                            stream));
            }
            return(result);
        }