aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetTransactions.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
index 8aa567c..dd1f8ba 100644
--- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
@@ -237,10 +237,23 @@ namespace OpenSim.Framework.Communications.Cache
237 SaveAssetToFile(filename, Asset.Data); 237 SaveAssetToFile(filename, Asset.Data);
238 } 238 }
239 } 239 }
240 240 ///Left this in and commented in case there are unforseen issues
241 //private void SaveAssetToFile(string filename, byte[] data)
242 //{
243 // FileStream fs = File.Create(filename);
244 // BinaryWriter bw = new BinaryWriter(fs);
245 // bw.Write(data);
246 // bw.Close();
247 // fs.Close();
248 //}
241 private void SaveAssetToFile(string filename, byte[] data) 249 private void SaveAssetToFile(string filename, byte[] data)
242 { 250 {
243 FileStream fs = File.Create(filename); 251 string assetPath = "UserAssets";
252 if (!Directory.Exists(assetPath))
253 {
254 Directory.CreateDirectory(assetPath);
255 }
256 FileStream fs = File.Create(Path.Combine(assetPath, filename));
244 BinaryWriter bw = new BinaryWriter(fs); 257 BinaryWriter bw = new BinaryWriter(fs);
245 bw.Write(data); 258 bw.Write(data);
246 bw.Close(); 259 bw.Close();
@@ -428,4 +441,4 @@ namespace OpenSim.Framework.Communications.Cache
428 441
429 #endregion 442 #endregion
430 } 443 }
431} \ No newline at end of file 444}