From 3e2510cbdac85bca72928aa763b9721339f6be8e Mon Sep 17 00:00:00 2001 From: "Matt@MBP13-PC" Date: Mon, 20 Aug 2012 10:51:14 -0100 Subject: [PATCH] Added code to auto seek stream to begining when saving via IFileSystem just in case --- src/Umbraco.Core/IO/PhysicalFileSystem.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Umbraco.Core/IO/PhysicalFileSystem.cs b/src/Umbraco.Core/IO/PhysicalFileSystem.cs index 3ea721dfdc..9b836cd2cf 100644 --- a/src/Umbraco.Core/IO/PhysicalFileSystem.cs +++ b/src/Umbraco.Core/IO/PhysicalFileSystem.cs @@ -83,6 +83,9 @@ namespace Umbraco.Core.IO EnsureDirectory(Path.GetDirectoryName(path)); + if (stream.CanSeek) + stream.Seek(0, 0); + using (var destination = (Stream)File.Create(GetFullPath(path))) stream.CopyTo(destination); }