From fc81ddc1d11901f14d0c20ec87944c5278e568ea Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 27 Aug 2008 18:59:42 +0000 Subject: From: Richard Alimi The following patch fixes the import of assets via the REST interface to use the proper Base64->Bytes conversion. The previous conversion did not work correctly for binary data, in particular for textures. --- OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/ApplicationPlugins') diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs index 9e4fae6..6b802d3 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs @@ -265,7 +265,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory asset.Type = SByte.Parse(xml.GetAttribute("type")); asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0; asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; - asset.Data = (new System.Text.ASCIIEncoding()).GetBytes(Rest.Base64ToString(xml.ReadElementContentAsString("Asset", ""))); + asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); Rest.AssetServices.AddAsset(asset); } -- cgit v1.1