diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake
index 25e54b7cbd73e169ca5c0bc7b9551100c7737c2e..36ea9270a7dab1c4dbc307cb759d826ac96281f1 100755
--- a/indra/cmake/Boost.cmake
+++ b/indra/cmake/Boost.cmake
@@ -15,10 +15,11 @@ if (USESYSTEMLIBS)
   set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
   set(BOOST_SYSTEM_LIBRARY boost_system-mt)
   set(BOOST_THREAD_LIBRARY boost_thread-mt)
+  set(BOOST_IOSTREAMS_LIBRARY boost_iostreams-mt)
 else (USESYSTEMLIBS)
   use_prebuilt_binary(boost)
   set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
-  set(BOOST_VERSION "1.55")
+  set(BOOST_VERSION "1.56")
 
   if (WINDOWS)
     if(MSVC80)
@@ -44,6 +45,9 @@ else (USESYSTEMLIBS)
       set(BOOST_THREAD_LIBRARY 
           optimized libboost_thread-vc80-mt-${BOOST_VERSION}
           debug libboost_thread-vc80-mt-gd-${BOOST_VERSION})
+      set(BOOST_IOSTREAMS_LIBRARY
+          optimized libboost_iostreams-vc80-mt-${BOOST_VERSION}
+          debug libboost_iostreams-vc80-mt-gd-${BOOST_VERSION})
     else(MSVC80)
       # MSVC 10.0 config
       set(BOOST_CONTEXT_LIBRARY 
@@ -70,6 +74,9 @@ else (USESYSTEMLIBS)
       set(BOOST_THREAD_LIBRARY 
           optimized libboost_thread-mt
           debug libboost_thread-mt-gd)
+      set(BOOST_IOSTREAMS_LIBRARY
+          optimized libboost_iostreams-mt
+          debug libboost_iostreams-mt-gd)
     endif (MSVC80)
   elseif (LINUX)
     set(BOOST_CONTEXT_LIBRARY
@@ -96,6 +103,9 @@ else (USESYSTEMLIBS)
     set(BOOST_THREAD_LIBRARY
         optimized boost_thread-mt
         debug boost_thread-mt-d)
+    set(BOOST_IOSTREAMS_LIBRARY
+        optimized boost_iostreams-mt
+        debug boost_iostreams-mt-d)
   elseif (DARWIN)
     set(BOOST_CONTEXT_LIBRARY
         optimized boost_context-mt
@@ -121,5 +131,8 @@ else (USESYSTEMLIBS)
     set(BOOST_THREAD_LIBRARY
         optimized boost_thread-mt
         debug boost_thread-mt-d)
+    set(BOOST_IOSTREAMS_LIBRARY
+        optimized boost_iostreams-mt
+        debug boost_iostreams-mt-d)
   endif (WINDOWS)
 endif (USESYSTEMLIBS)
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index 99b16b303169712f2db26db91c148ad3bf185217..5c4c61bbedf2250c4eee10094a4cde1e0e4263c4 100755
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -34,6 +34,8 @@
 #include "llavatarappearancedefines.h"
 #include "llwearable.h"
 #include "boost/bind.hpp"
+#include <boost/iostreams/device/file_descriptor.hpp>
+#include <boost/iostreams/stream.hpp>
 
 using namespace LLAvatarAppearanceDefines;
 
@@ -88,7 +90,9 @@ LLAssetType::EType LLWearable::getAssetType() const
 
 BOOL LLWearable::exportFile(LLFILE* fp) const
 {
-	llofstream ofs(fp);
+	using namespace boost::iostreams;
+	stream_buffer<file_descriptor_sink> bis(fileno(fp), never_close_handle);
+	std::ostream ofs(&bis);
 	return exportStream(ofs);
 }
 
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 66ee8d615abe1652b3eb7ec625a61c7c8f86da4e..f0b5d75084c86b750c203ac3538cead760e5bebe 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2041,6 +2041,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
     ${BOOST_PROGRAM_OPTIONS_LIBRARY}
     ${BOOST_REGEX_LIBRARY}
     ${BOOST_CONTEXT_LIBRARY}
+    ${BOOST_IOSTREAMS_LIBRARY}
     ${BOOST_COROUTINE_LIBRARY}
     ${DBUSGLIB_LIBRARIES}
     ${OPENGL_LIBRARIES}
diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp
index 74f1cf58319573e523b2343867b3a5d5e1f495d4..cc94b83820ea1ea61c6329e824817e1b0d4928f0 100755
--- a/indra/newview/llviewerwearable.cpp
+++ b/indra/newview/llviewerwearable.cpp
@@ -29,6 +29,7 @@
 #include "llagent.h"
 #include "llagentcamera.h"
 #include "llagentwearables.h"
+#include "llassetuploadresponders.h"
 #include "llfloatersidepanelcontainer.h"
 #include "lllocaltextureobject.h"
 #include "llnotificationsutil.h"
@@ -534,28 +535,29 @@ void LLViewerWearable::saveNewAsset() const
 	// save it out to database
 	if( gAssetStorage )
 	{
-		 /*
-		std::string url = gAgent.getRegion()->getCapability("NewAgentInventory");
+#if 0
+		const std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory");
 		if (!url.empty())
 		{
 			LL_INFOS() << "Update Agent Inventory via capability" << LL_ENDL;
 			LLSD body;
-			body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetToFolderType(getAssetType()));
+			body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(getAssetType()));
 			body["asset_type"] = LLAssetType::lookup(getAssetType());
 			body["inventory_type"] = LLInventoryType::lookup(LLInventoryType::IT_WEARABLE);
 			body["name"] = getName();
 			body["description"] = getDescription();
-			LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, filename));
+			LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, filename,
+																		   getAssetType()));
 		}
 		else
+#endif // 0
 		{
+			LLWearableSaveData* data = new LLWearableSaveData;
+			data->mType = mType;
+			gAssetStorage->storeAssetData(filename, mTransactionID, getAssetType(),
+										  &LLViewerWearable::onSaveNewAssetComplete,
+										  (void*)data);
 		}
-		 */
-		 LLWearableSaveData* data = new LLWearableSaveData;
-		 data->mType = mType;
-		 gAssetStorage->storeAssetData(filename, mTransactionID, getAssetType(),
-                                     &LLViewerWearable::onSaveNewAssetComplete,
-                                     (void*)data);
 	}
 }