diff -ruN --strip-trailing-cr BitcasaDLL-20140103/BitcasaDLL/BitcasaAPI.cpp BitcasaDLL-20140105/BitcasaDLL/BitcasaAPI.cpp
--- BitcasaDLL-20140103/BitcasaDLL/BitcasaAPI.cpp	2014-01-03 16:04:58.000000000 +0900
+++ BitcasaDLL-20140105/BitcasaDLL/BitcasaAPI.cpp	2014-01-05 21:15:52.000000000 +0900
@@ -1,6 +1,8 @@
 #include "stdafx.h"
 #include "BitcasaAPI.h"
 
+using namespace System::Threading;
+
 const char *ClientID = "";
 const char *ClientSecret = "";
 
@@ -436,7 +438,7 @@
 
 //File Operations
 // Upload File
-bool BitcasaAPI::UploadFile(std::string encoded_path, std::wstring infilename, void(*callback)(INT64))
+bool BitcasaAPI::UploadFile(std::string encoded_path, std::wstring infilename, void(CALLBACK *callback)(INT64))
 {
 	if (encoded_path.empty()) encoded_path = "/";
 	if (encoded_path[0] != '/') encoded_path = "/" + encoded_path;
@@ -464,11 +466,93 @@
 	return true;
 }
 
+ref class threadwork{
+private:
+	HttpsClient *bitcasa;
+	std::string *access_token;
+	std::string *URI;
+public:
+	bool alive;
+	bool partial;
+	HANDLE readySlave;
+	HANDLE readyMaster;
+	INT64 offset;
+	INT64 len;
+	std::vector<char> *buf;
+
+	threadwork(std::string url, std::string token){
+		bitcasa = new HttpsClient();
+		readySlave = CreateEvent(NULL, false, false, NULL);
+		readyMaster = CreateEvent(NULL, false, false, NULL);
+		access_token = new std::string;
+		URI = new std::string;
+		buf = new std::vector<char>;
+		alive = true;
+		*URI = url;
+		*access_token = token;
+	}
+	~threadwork(){
+		CloseHandle(readySlave);
+		CloseHandle(readyMaster);
+		delete access_token;
+		delete URI;
+		delete buf;
+		delete bitcasa;
+	}
+	void DoWork(){
+		while (alive){
+			if ((WaitForSingleObject(readySlave, INFINITE) != WAIT_OBJECT_0) || !alive)
+				break;
+			std::cerr << "thread " << GetCurrentThreadId() << " wake." << std::endl;
+			std::cerr << "thread " << GetCurrentThreadId() << " offset:" << offset << std::endl;
+			bitcasa->Clear();
+			bitcasa->request.query["access_token"] = *access_token;
+			bitcasa->AddHeader("Range", dynamic_cast<std::stringstream &>(std::stringstream() << "bytes=" << offset << "-" << (offset + len - 1)).str());
+			if (bitcasa->GET(*URI) != 0){
+				std::cerr << "thread " << GetCurrentThreadId() << " DownloadFile failed" << std::endl;
+				std::cerr << bitcasa->response.line << std::endl;
+				for (auto it = bitcasa->response.header.begin(); it != bitcasa->response.header.end(); ++it)
+					std::cerr << it->first << ": " << it->second << std::endl;
+				std::cerr << std::string(bitcasa->response.body.begin(), bitcasa->response.body.end()) << std::endl;
+				Sleep(1000 * 10);
+				continue;
+			}
+
+			std::wcerr << ".";
+			if (bitcasa->response.code == 503){
+				Sleep(1000 * 10);
+				continue;
+			}
+			if ((bitcasa->response.code != 200) && (bitcasa->response.code != 206)) {
+				std::wcerr << std::endl;
+				std::cerr << "DownloadFile failed" << std::endl;
+				std::cerr << std::string(bitcasa->response.body.begin(), bitcasa->response.body.end()) << std::endl;
+				buf->resize(0);
+				SetEvent(readyMaster);
+				break;
+			}
+			INT64 ContentLength = -1;
+			auto it_length = bitcasa->response.header.find("Content-Length");
+			std::stringstream((it_length != bitcasa->response.header.end()) ? it_length->second : "") >> ContentLength;
+			if (bitcasa->response.code == 200){
+				partial = false;
+			}
+			else {
+				partial = true;
+			}
+			*buf = bitcasa->response.body;
+			std::cerr << "thread " << GetCurrentThreadId() << "done. offset:" << offset << std::endl;
+			SetEvent(readyMaster);
+		}
+		std::cerr << "thread " << GetCurrentThreadId() << " done." << std::endl;
+	}
+};
 
 //File Operations
 // Download/Stream File
-bool BitcasaAPI::DownloadFile(std::string encoded_file_id, std::wstring filename, INT64 wantSize, void(*callback)(INT64 trans))
+bool BitcasaAPI::DownloadFile(std::string encoded_file_id, std::wstring filename, INT64 wantSize, void(CALLBACK *callback)(INT64 trans))
 {
+	if (wantSize < 0) return false;
 	if (encoded_file_id.empty() || (encoded_file_id.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_=") != std::string::npos)){
 		std::cerr << "Invalid File id" << std::endl;
 		return false;
@@ -483,60 +567,100 @@
 		}
 	}
 	std::ostream& out = (filename.empty()) ? std::cout : fout;
-	
 	std::wcerr << "download.";
+
 	const int transbytes = 64 * 1024 * 1024;
 	INT64 offset = 0;
-	int retrycount = 100;
-	while (true){
-		if (callback) callback(offset);
-		bitcasa.Clear();
-		bitcasa.request.query["access_token"] = WideChartoUTF8(access_token);
-		bitcasa.AddHeader("Range", dynamic_cast<std::stringstream &>(std::stringstream() << "bytes=" << offset << "-" << (offset + transbytes - 1)).str());
-		if (bitcasa.GET(URI) != 0){
-			if (--retrycount > 0)
-				continue;
-		}
-
-		std::wcerr << ".";
-		if (bitcasa.response.code == 503){
-			Sleep(1000*10);
-			if (--retrycount > 0)
-				continue;
-		}
-		if ((bitcasa.response.code != 200) && (bitcasa.response.code != 206)) {
-			std::wcerr << std::endl;
-			std::cerr << "DownloadFile failed" << std::endl;
-			std::cerr << std::string(bitcasa.response.body.begin(), bitcasa.response.body.end()) << std::endl;
-			return false;
+	INT64 progress = 0;
+	int working;
+	int threadcount = (int)(wantSize / transbytes) + 1;
+	threadcount = (threadcount > 5) ? 5 : threadcount;
+
+	System::Collections::Generic::List<Thread ^> workThreads;
+	System::Collections::Generic::List<threadwork^> data;
+	std::vector<HANDLE> waithandles;
+	for (int i = 0; i < threadcount; i++){
+		threadwork^ work = gcnew threadwork(URI, WideChartoUTF8(access_token));
+		data.Add(work);
+		HANDLE h = work->readyMaster;
+		waithandles.push_back(h);
+		workThreads.Add(gcnew Thread(gcnew ThreadStart(work, &threadwork::DoWork)));
+	}
+	for (int i = 0; i < threadcount; i++){
+		workThreads[i]->Start();
+	}
+	for (working = 0; working < threadcount; working++){
+		threadwork^ work = data[working];
+		work->len = (offset+transbytes < wantSize)? transbytes: wantSize-offset;
+		work->offset = offset;
+		SetEvent(work->readySlave);
+		offset += work->len;
+		Sleep(5*1000);
+	}
+	try{
+		while (working > 0){
+			auto ret = WaitForMultipleObjects(waithandles.size(), &waithandles[0], false, INFINITE);
+			int thread_no = -1;
+			if ((ret >= WAIT_OBJECT_0) && (ret < WAIT_OBJECT_0 + waithandles.size())) thread_no = ret - WAIT_OBJECT_0;
+			if ((ret >= WAIT_ABANDONED_0) && (ret < WAIT_ABANDONED_0 + waithandles.size())) thread_no = ret - WAIT_ABANDONED_0;
+			if (thread_no < 0) return false;
+
+			threadwork^ work = data[thread_no];
+
+			if (work->partial){
+				// 206 success range
+				if (work->buf->size() == work->len)
+				{
+					out.seekp(work->offset, std::ios::beg);
+					out.write(&(*work->buf)[0], work->buf->size());
+					if (callback)
+					{
+						progress = (progress < work->offset) ? work->offset : progress;
+						callback(progress);
+					}
+					if (offset < wantSize){
+						work->len = (offset + transbytes < wantSize) ? transbytes : wantSize - offset;
+						work->offset = offset;
+						SetEvent(work->readySlave);
+						offset += work->len;
+						continue;
+					}
+					else {
+						work->alive = false;
+						working--;
+						continue;
+					}
+				}
+				std::cerr << "206 unmatch want:" << work->len << " ret:" << work->buf->size() << std::endl;
+			}
+			else{
+				// 200 want range but return all
+				out.seekp(0, std::ios::beg);
+				out.write(&(*work->buf)[0], work->buf->size());
+				if (work->buf->size() == wantSize)
+				{
+					offset = work->buf->size();
+					break;
+				}
+				std::cerr << "200 unmatch want:" << wantSize << " ret:" << work->buf->size() << std::endl;
+			}
+			// retry
+			std::cerr << "retry " << work->offset << ":" << work->len << std::endl;
+			SetEvent(work->readySlave);
 		}
-		INT64 ContentLength = -1;
-		auto it_length = bitcasa.response.header.find("Content-Length");
-		std::stringstream((it_length != bitcasa.response.header.end()) ? it_length->second : "") >> ContentLength;
-		if (bitcasa.response.code == 200){
-			out.seekp(0, std::ios::beg);
-			out.write(&bitcasa.response.body[0], bitcasa.response.body.size());
-			offset = ContentLength;
-			if ((wantSize >= 0) && (offset != wantSize))
-				return false;
-			break;
+		if (callback) callback(offset);
+		std::wcerr << "done" << std::endl;
+		return true;
+	}
+	finally{
+		for (int i = 0; i < threadcount; i++){
+			data[i]->alive = false;
+			SetEvent(data[i]->readySlave);
 		}
-		out.seekp(offset, std::ios::beg);
-		out.write(&bitcasa.response.body[0], bitcasa.response.body.size());
-		if (ContentLength < transbytes){
-			if ((wantSize >= 0) && (offset+ContentLength != wantSize)){
-				continue;
-			}
-			offset += ContentLength;
-			break;
+		for (int i = 0; i < threadcount; i++){
+			workThreads[i]->Join();
 		}
-		offset += transbytes;
 	}
-	if ((wantSize >= 0) && (offset != wantSize))
-		return false;
-	if (callback) callback(offset);
-	std::wcerr << "done" << std::endl;
-	return true;
 }
 
 //File Operations
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/BitcasaDLL/BitcasaAPI.h BitcasaDLL-20140105/BitcasaDLL/BitcasaAPI.h
--- BitcasaDLL-20140103/BitcasaDLL/BitcasaAPI.h	2013-12-30 00:26:12.000000000 +0900
+++ BitcasaDLL-20140105/BitcasaDLL/BitcasaAPI.h	2014-01-05 18:49:24.000000000 +0900
@@ -42,11 +42,11 @@
 	}
 
 	///////////////////////////////////////
-	bool UploadFile(std::string encoded_path, std::wstring infilename, void(*callback)(INT64) = NULL);
+	bool UploadFile(std::string encoded_path, std::wstring infilename, void(CALLBACK *callback)(INT64) = NULL);
 	inline bool UploadFile(std::wstring encoded_path, std::wstring infilename){
 		return UploadFile(WideChartoUTF8(encoded_path), infilename);
 	}
-	bool DownloadFile(std::string encoded_file_id, std::wstring filename, INT64 wantSize = -1,void(*callback)(INT64 trans) = NULL);
+	bool DownloadFile(std::string encoded_file_id, std::wstring filename, INT64 wantSize = -1, void(CALLBACK *callback)(INT64 trans) = NULL);
 	inline bool DownloadFile(const std::wstring &encoded_file_id, const std::wstring &filename, INT64 wantSize = -1){
 		return DownloadFile(WideChartoUTF8(encoded_file_id), filename, wantSize);
 	}
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/BitcasaDLL/BitcasaDLL.vcxproj BitcasaDLL-20140105/BitcasaDLL/BitcasaDLL.vcxproj
--- BitcasaDLL-20140103/BitcasaDLL/BitcasaDLL.vcxproj	2013-12-28 20:43:00.000000000 +0900
+++ BitcasaDLL-20140105/BitcasaDLL/BitcasaDLL.vcxproj	2014-01-04 17:42:10.000000000 +0900
@@ -1,10 +1,18 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Debug|x64">
       <Configuration>Debug</Configuration>
       <Platform>x64</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|x64">
       <Configuration>Release</Configuration>
       <Platform>x64</Platform>
@@ -24,6 +32,13 @@
     <CLRSupport>true</CLRSupport>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <CLRSupport>true</CLRSupport>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
@@ -31,25 +46,52 @@
     <CLRSupport>true</CLRSupport>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <CLRSupport>true</CLRSupport>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <LinkIncremental>true</LinkIncremental>
     <IncludePath>$(SolutionDir)ssl\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)ssl\lib;$(LibraryPath)</LibraryPath>
+    <LibraryPath>$(SolutionDir)ssl\x64\lib;$(LibraryPath)</LibraryPath>
+    <ReferencePath>$(SolutionDir)WebWindow\bin\x64\Debug;$(ReferencePath)</ReferencePath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <IncludePath>$(SolutionDir)ssl\include;$(IncludePath)</IncludePath>
+    <LibraryPath>$(SolutionDir)ssl\x86\lib;$(LibraryPath)</LibraryPath>
+    <ReferencePath>$(SolutionDir)WebWindow\bin\x86\Debug;$(ReferencePath)</ReferencePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <LinkIncremental>false</LinkIncremental>
     <IncludePath>$(SolutionDir)ssl\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)ssl\lib;$(LibraryPath)</LibraryPath>
+    <LibraryPath>$(SolutionDir)ssl\x64\lib;$(LibraryPath)</LibraryPath>
+    <ReferencePath>$(SolutionDir)WebWindow\bin\x64\Release;$(ReferencePath)</ReferencePath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <IncludePath>$(SolutionDir)ssl\include;$(IncludePath)</IncludePath>
+    <LibraryPath>$(SolutionDir)ssl\x86\lib;$(LibraryPath)</LibraryPath>
+    <ReferencePath>$(SolutionDir)WebWindow\bin\x86\Release;$(ReferencePath)</ReferencePath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
@@ -64,6 +106,26 @@
       <AdditionalDependencies>
       </AdditionalDependencies>
     </Link>
+    <PostBuildEvent>
+      <Command>Copy "$(TargetPath)" "$(SolutionDir)bin\"</Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>
+      </AdditionalDependencies>
+    </Link>
+    <PostBuildEvent>
+      <Command>Copy "$(TargetPath)" "$(SolutionDir)bin\"</Command>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
@@ -77,14 +139,30 @@
       <AdditionalDependencies>
       </AdditionalDependencies>
     </Link>
+    <PostBuildEvent>
+      <Command>Copy "$(TargetPath)" "$(SolutionDir)bin\"</Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <AdditionalDependencies>
+      </AdditionalDependencies>
+    </Link>
+    <PostBuildEvent>
+      <Command>Copy "$(TargetPath)" "$(SolutionDir)bin\"</Command>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
-    <Reference Include="WebWindow">
-      <HintPath>..\WebWindow\bin\x64\Release\WebWindow.dll</HintPath>
-    </Reference>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="bf_logger.h" />
@@ -103,7 +181,9 @@
     <ClCompile Include="http_client.cpp" />
     <ClCompile Include="Stdafx.cpp">
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
     </ClCompile>
     <ClCompile Include="util.cpp" />
   </ItemGroup>
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/BitcasaDLL/BitcasaWrapper.cpp BitcasaDLL-20140105/BitcasaDLL/BitcasaWrapper.cpp
--- BitcasaDLL-20140103/BitcasaDLL/BitcasaWrapper.cpp	2014-01-01 08:59:04.000000000 +0900
+++ BitcasaDLL-20140105/BitcasaDLL/BitcasaWrapper.cpp	2014-01-05 18:49:24.000000000 +0900
@@ -189,7 +189,7 @@
 bool BitcasaWrapper::UploadFile(System::String^ encoded_path, System::String^ infilename, filetrans^ callback)
 {
 	IntPtr delegatePointer = System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(callback);
-	return obj->UploadFile(SystemStringToStdString(encoded_path), SystemStringToStdWString(infilename), (void(*)(INT64))delegatePointer.ToPointer());
+	return obj->UploadFile(SystemStringToStdString(encoded_path), SystemStringToStdWString(infilename), (void(CALLBACK *)(INT64))delegatePointer.ToPointer());
 }
 
 bool BitcasaWrapper::DownloadFile(System::String^ encoded_file_id, System::String^ filename, Int64 filesize)
@@ -199,7 +199,7 @@
 bool BitcasaWrapper::DownloadFile(System::String^ encoded_file_id, System::String^ filename, Int64 filesize, filetrans^ callback)
 {
 	IntPtr delegatePointer = System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(callback);
-	return obj->DownloadFile(SystemStringToStdString(encoded_file_id), SystemStringToStdWString(filename), filesize, (void(*)(INT64))delegatePointer.ToPointer());
+	return obj->DownloadFile(SystemStringToStdString(encoded_file_id), SystemStringToStdWString(filename), filesize, (void(CALLBACK *)(INT64))delegatePointer.ToPointer());
 }
 
 bool BitcasaWrapper::_DeleteFile(System::String^ encoded_path)
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/BitcasaDLL/BitcasaWrapper.h BitcasaDLL-20140105/BitcasaDLL/BitcasaWrapper.h
--- BitcasaDLL-20140103/BitcasaDLL/BitcasaWrapper.h	2014-01-01 08:12:30.000000000 +0900
+++ BitcasaDLL-20140105/BitcasaDLL/BitcasaWrapper.h	2014-01-04 01:24:24.000000000 +0900
@@ -2,6 +2,8 @@
 #include "stdafx.h"
 #include <typeinfo>
 
+#using "WebWindow.dll"
+
 using namespace System;
 using namespace WebWindow;
 
@@ -88,7 +90,7 @@
 			}
 		}
 		inline bool GetBool() {
-			if ((type == jsonitem::boolean) && (String::Compare(json, "true"))) return true;
+			if ((type == jsonitem::boolean) && (String::Compare(json, "true") == 0)) return true;
 			return false;
 		}
 		virtual inline System::String^ GetString() {
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/BitcasaDLL/http_client.cpp BitcasaDLL-20140105/BitcasaDLL/http_client.cpp
--- BitcasaDLL-20140103/BitcasaDLL/http_client.cpp	2014-01-03 16:04:40.000000000 +0900
+++ BitcasaDLL-20140105/BitcasaDLL/http_client.cpp	2014-01-05 20:18:16.000000000 +0900
@@ -34,16 +34,20 @@
 std::random_device rd;
 std::mt19937_64 gen(rd());
 
+std::fstream ConsoleInput, ConsoleOutput, ConsoleError;
+
+bool HttpsClient::initialize = false;
 
 HttpsClient::HttpsClient()
 {
 	/* Set up the library */
-
-	ERR_load_BIO_strings();
-	SSL_load_error_strings();
-	OpenSSL_add_all_algorithms();
-	SSL_library_init();
-
+	if (!HttpsClient::initialize){
+		ERR_load_BIO_strings();
+		SSL_load_error_strings();
+		OpenSSL_add_all_algorithms();
+		SSL_library_init();
+		HttpsClient::initialize = true;
+	}
 	/* Set up the SSL context */
 
 	ctx = SSL_CTX_new(SSLv23_client_method());
@@ -52,7 +56,7 @@
 		exit(1);
 	}
 	SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2);
-	SSL_CTX_set_timeout(ctx, 180);
+	SSL_CTX_set_timeout(ctx, 300);
 
 	/* Load the trust store */
 
@@ -65,11 +69,20 @@
 
 	bio = BIO_new_buffer_ssl_connect(ctx);
 	if (false){
+		AllocConsole();
+		ConsoleInput.open("CONIN$", std::ios::in);
+		ConsoleOutput.open("CONOUT$", std::ios::out);
+		ConsoleError.open("CONOUT$", std::ios::out);
+		std::cin.rdbuf(ConsoleInput.rdbuf());
+		std::cout.rdbuf(ConsoleOutput.rdbuf());
+		std::cerr.rdbuf(ConsoleError.rdbuf());
+	}
+	if (false){
 		BIO *bio_logger = BIO_new_filelogger(_T("trace.log"));
 		bio = BIO_push(bio_logger, bio);
 	}
 	struct timeval timeout;
-	timeout.tv_sec = 180;
+	timeout.tv_sec = 300;
 	timeout.tv_usec = 0;
 	BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_RECV_TIMEOUT, 0, &timeout);
 
@@ -142,8 +155,16 @@
 			BIO_reset(bio);
 			continue;
 		}
-		std::stringstream(response.line.substr(9, 3)) >> response.code;
-		response.reason = response.line.substr(13);
+		try{
+			std::stringstream(response.line.substr(9, 3)) >> response.code;
+			response.reason = response.line.substr(13);
+		}
+		catch (...){
+			response.code = 0;
+			response.reason = "";
+			BIO_reset(bio);
+			continue;
+		}
 
 		std::string head_line = ReadLine();
 		while (head_line != "\r\n") {
@@ -159,15 +180,15 @@
 			return 0;
 		}
 		bool tempread = true;
-		if (ContentLength > 0) {
-			response.body.resize(ContentLength);
+		if ((ContentLength > 0) && (ContentLength < INT_MAX)) {
+			response.body.resize((int)ContentLength);
 			tempread = false;
 		}
 		size_t len = 0;
 		if (tempread) {
 			buffer.resize(4096);
 			response.body.resize(0);
-			while ((ContentLength < 0) || (len >= ContentLength)){
+			while ((ContentLength < 0) || (len <= ContentLength)){
 				int p = BIO_read(bio, &buffer[0], (int)buffer.size());
 				if (p <= 0){
 					break;
@@ -192,7 +213,7 @@
 	return 1;
 }
 
-int HttpsClient::sendfile(std::ifstream& infile, std::string filename, void (*callback)(INT64))
+int HttpsClient::sendfile(std::ifstream& infile, std::string filename, void (CALLBACK *callback)(INT64))
 {
 	// get filesize
 	infile.seekg(0, std::fstream::end);
@@ -250,8 +271,16 @@
 			BIO_reset(bio);
 			continue;
 		}
-		std::stringstream(response.line.substr(9, 3)) >> response.code;
-		response.reason = response.line.substr(13);
+		try{
+			std::stringstream(response.line.substr(9, 3)) >> response.code;
+			response.reason = response.line.substr(13);
+		}
+		catch (...){
+			response.code = 0;
+			response.reason = "";
+			BIO_reset(bio);
+			continue;
+		}
 
 		// 100
 		if (response.code != 100){
@@ -291,14 +320,22 @@
 
 	/* Read in the response */
 	response.line = ReadLine();
+	if (response.line.empty()) {
+		BIO_reset(bio);
+		return 1;
+	}
 	//012345678901234
 	//HTTP/1.1 200 OK
-	if (response.line.empty()) {
+	try{
+		std::stringstream(response.line.substr(9, 3)) >> response.code;
+		response.reason = response.line.substr(13);
+	}
+	catch (...){
+		response.code = 0;
+		response.reason = "";
 		BIO_reset(bio);
 		return 1;
 	}
-	std::stringstream(response.line.substr(9, 3)) >> response.code;
-	response.reason = response.line.substr(13);
 
 	std::string head_line = ReadLine();
 	while (head_line != "\r\n") {
@@ -314,15 +351,15 @@
 		return 0;
 	}
 	bool tempread = true;
-	if (ContentLength > 0) {
-		response.body.resize(ContentLength);
+	if ((ContentLength > 0) && (ContentLength < INT_MAX)) {
+		response.body.resize((int)ContentLength);
 		tempread = false;
 	}
 	size_t len = 0;
 	if (tempread) {
 		buffer.resize(4096);
 		response.body.resize(0);
-		while ((ContentLength < 0) || (len >= ContentLength)){
+		while ((ContentLength < 0) || (len <= ContentLength)){
 			int p = BIO_read(bio, &buffer[0], (int)buffer.size());
 			if (p <= 0) break;
 			response.body.resize(len + p);
@@ -347,7 +384,7 @@
 {
 	buffer.resize(4096);
 	int p = BIO_gets(bio, &buffer[0], (int)buffer.size());
-	if (p <= 0) return std::string();
+	if (p <= 0) return "";
 	buffer[p] = 0;
 	return std::string(&buffer[0]);
 }
@@ -387,7 +424,7 @@
 	return send();
 }
 
-int HttpsClient::POSTfile(std::string URI, std::map<std::string, std::string> formdata, std::wstring filename, void(*callback)(INT64))
+int HttpsClient::POSTfile(std::string URI, std::map<std::string, std::string> formdata, std::wstring filename, void(CALLBACK *callback)(INT64))
 {
 	std::string body = CreateQueryURI(formdata);
 	URI += CreateQueryURI(request.query);
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/BitcasaDLL/http_client.h BitcasaDLL-20140105/BitcasaDLL/http_client.h
--- BitcasaDLL-20140103/BitcasaDLL/http_client.h	2013-12-30 00:26:12.000000000 +0900
+++ BitcasaDLL-20140105/BitcasaDLL/http_client.h	2014-01-05 20:00:32.000000000 +0900
@@ -9,6 +9,7 @@
 	~HttpsClient();
 
 private:
+	static bool initialize;
 	BIO *bio;
 	SSL *ssl;
 	SSL_SESSION *sess;
@@ -17,7 +18,7 @@
 	BIO *cbio;
 
 	int send();
-	int sendfile(std::ifstream& infile, std::string filename, void(*callback)(INT64) = NULL);
+	int sendfile(std::ifstream& infile, std::string filename, void(CALLBACK *callback)(INT64) = NULL);
 	std::string ReadLine();
 
 public:
@@ -43,7 +44,7 @@
 	int GET(std::string URI);
 	int POST(std::string URI);
 	int POST(std::string URI, std::map<std::string,std::string> formdata);
-	int POSTfile(std::string URI, std::map<std::string, std::string> formdata, std::wstring filename, void(*callback)(INT64) = NULL);
+	int POSTfile(std::string URI, std::map<std::string, std::string> formdata, std::wstring filename, void(CALLBACK *callback)(INT64) = NULL);
 	int _DELETE(std::string URI);
 	int _DELETE(std::string URI, std::map<std::string, std::string> formdata);
 
@@ -51,4 +52,3 @@
 	int Clear();
 	void Reset() { if(bio) BIO_reset(bio); }
 };
-
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/BitcasaDLL/Stdafx.h BitcasaDLL-20140105/BitcasaDLL/Stdafx.h
--- BitcasaDLL-20140103/BitcasaDLL/Stdafx.h	2013-12-27 11:27:10.000000000 +0900
+++ BitcasaDLL-20140105/BitcasaDLL/Stdafx.h	2014-01-05 08:24:28.000000000 +0900
@@ -32,6 +32,7 @@
 #include <functional>
 #include <iterator>
 #include <random>
+#include <queue>
 
 typedef std::basic_string<TCHAR> tstring;
 typedef std::basic_stringstream<TCHAR> tstringstream;
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/BitcasaDLL.sln BitcasaDLL-20140105/BitcasaDLL.sln
--- BitcasaDLL-20140103/BitcasaDLL.sln	2013-12-28 20:40:20.000000000 +0900
+++ BitcasaDLL-20140105/BitcasaDLL.sln	2014-01-04 01:45:06.000000000 +0900
@@ -13,27 +13,42 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bitcasaViewer", "bitcasaViewer\bitcasaViewer.csproj", "{075C0997-3D0C-4559-938C-450B32D8F636}"
 	ProjectSection(ProjectDependencies) = postProject
 		{5EF55107-A2C4-40CA-BBB1-421D5160980B} = {5EF55107-A2C4-40CA-BBB1-421D5160980B}
+		{7C2A49DA-E723-42D5-A890-5FFF2F4A843B} = {7C2A49DA-E723-42D5-A890-5FFF2F4A843B}
 	EndProjectSection
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
 		Debug|x64 = Debug|x64
+		Release|Win32 = Release|Win32
 		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{5EF55107-A2C4-40CA-BBB1-421D5160980B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5EF55107-A2C4-40CA-BBB1-421D5160980B}.Debug|Win32.Build.0 = Debug|Win32
 		{5EF55107-A2C4-40CA-BBB1-421D5160980B}.Debug|x64.ActiveCfg = Debug|x64
 		{5EF55107-A2C4-40CA-BBB1-421D5160980B}.Debug|x64.Build.0 = Debug|x64
 		{5EF55107-A2C4-40CA-BBB1-421D5160980B}.Debug|x64.Deploy.0 = Debug|x64
+		{5EF55107-A2C4-40CA-BBB1-421D5160980B}.Release|Win32.ActiveCfg = Release|Win32
+		{5EF55107-A2C4-40CA-BBB1-421D5160980B}.Release|Win32.Build.0 = Release|Win32
 		{5EF55107-A2C4-40CA-BBB1-421D5160980B}.Release|x64.ActiveCfg = Release|x64
 		{5EF55107-A2C4-40CA-BBB1-421D5160980B}.Release|x64.Build.0 = Release|x64
+		{7C2A49DA-E723-42D5-A890-5FFF2F4A843B}.Debug|Win32.ActiveCfg = Debug|x86
+		{7C2A49DA-E723-42D5-A890-5FFF2F4A843B}.Debug|Win32.Build.0 = Debug|x86
 		{7C2A49DA-E723-42D5-A890-5FFF2F4A843B}.Debug|x64.ActiveCfg = Debug|x64
 		{7C2A49DA-E723-42D5-A890-5FFF2F4A843B}.Debug|x64.Build.0 = Debug|x64
 		{7C2A49DA-E723-42D5-A890-5FFF2F4A843B}.Debug|x64.Deploy.0 = Debug|x64
+		{7C2A49DA-E723-42D5-A890-5FFF2F4A843B}.Release|Win32.ActiveCfg = Release|x86
+		{7C2A49DA-E723-42D5-A890-5FFF2F4A843B}.Release|Win32.Build.0 = Release|x86
 		{7C2A49DA-E723-42D5-A890-5FFF2F4A843B}.Release|x64.ActiveCfg = Release|x64
 		{7C2A49DA-E723-42D5-A890-5FFF2F4A843B}.Release|x64.Build.0 = Release|x64
+		{075C0997-3D0C-4559-938C-450B32D8F636}.Debug|Win32.ActiveCfg = Debug|x86
+		{075C0997-3D0C-4559-938C-450B32D8F636}.Debug|Win32.Build.0 = Debug|x86
 		{075C0997-3D0C-4559-938C-450B32D8F636}.Debug|x64.ActiveCfg = Debug|x64
 		{075C0997-3D0C-4559-938C-450B32D8F636}.Debug|x64.Build.0 = Debug|x64
 		{075C0997-3D0C-4559-938C-450B32D8F636}.Debug|x64.Deploy.0 = Debug|x64
+		{075C0997-3D0C-4559-938C-450B32D8F636}.Release|Win32.ActiveCfg = Release|x86
+		{075C0997-3D0C-4559-938C-450B32D8F636}.Release|Win32.Build.0 = Release|x86
 		{075C0997-3D0C-4559-938C-450B32D8F636}.Release|x64.ActiveCfg = Release|x64
 		{075C0997-3D0C-4559-938C-450B32D8F636}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/bitcasaViewer/BitcasaServer.cs BitcasaDLL-20140105/bitcasaViewer/BitcasaServer.cs
--- BitcasaDLL-20140103/bitcasaViewer/BitcasaServer.cs	2014-01-02 04:04:34.000000000 +0900
+++ BitcasaDLL-20140105/bitcasaViewer/BitcasaServer.cs	2014-01-04 17:35:56.000000000 +0900
@@ -44,7 +44,7 @@
                     if (callback != null) callback(75);
                     BitcasaFileInfo.dirLoaded[fullpath] = true;
                     var root = result["result"]["items"];
-                    for (ulong i = 0; i < root.size; i++)
+                    for (uint i = 0; i < root.size; i++)
                     {
                         var item = root.Items(i);
                         BitcasaFileInfo.GetItem((item as json_objectWrapper), "");
@@ -66,7 +66,7 @@
                 if (callback != null) callback(75);
                 BitcasaFileInfo.dirLoaded[""] = true;
                 BitcasaFileInfo.dirLoaded["\\"] = true;
-                for (ulong i = 0; i < root.size; i++)
+                for (uint i = 0; i < root.size; i++)
                 {
                     var item = root.Items(i);
                     var path = BitcasaFileInfo.GetItem((item as json_objectWrapper), "").fullpath;
@@ -95,18 +95,22 @@
         public bool download(BitcasaFileInfo target, string localfilename, delegateProgressBar callback)
         {
             if (target.id == "") return false;
-            return bitcasa.DownloadFile(
+            Int64 size = target.size;
+            var ret = bitcasa.DownloadFile(
                 target.id, 
                 localfilename,
-                target.size,
+                size,
                 new filetrans(
                     (Int64 pos)=>{
                         if (callback != null)
                         {
-                            callback((int)(100.0 * pos / target.size));
+                            System.Console.Error.WriteLine("pos:" + pos.ToString());
+                            System.Console.Error.WriteLine("size:" + size.ToString());
+                            callback((int)(100.0 * pos / size));
                         }
                     })
                 );
+            return ret;
         }
 
         public bool upload(BitcasaFileInfo targetdir, string localfilename, delegateProgressBar callback)
@@ -114,7 +118,7 @@
             if(callback != null) callback(0);
             if (targetdir.path == "") return false;
             Int64 filesize = 1;
-            return bitcasa.UploadFile(
+            var ret = bitcasa.UploadFile(
                 targetdir.path, 
                 localfilename,
                 new filetrans(
@@ -128,11 +132,12 @@
                         }
                     })
                 );
+            return ret;
         }
 
         public bool rename(BitcasaFileInfo target, string newname, delegateProgressBar callback)
         {
-            bool ret;
+            bool ret = true;
             if(callback != null) callback(0);
             if(newname == "") return false;
             if(callback != null) callback(25);
@@ -211,7 +216,7 @@
 
         public bool mkDir(BitcasaFileInfo targetdir, string newname, delegateProgressBar callback)
         {
-            bool ret;
+            bool ret = true;
             if (callback != null) callback(0);
             if (newname == "") return false;
             if (targetdir.category != "folders") return false;
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/bitcasaViewer/bitcasaViewer.csproj BitcasaDLL-20140105/bitcasaViewer/bitcasaViewer.csproj
--- BitcasaDLL-20140103/bitcasaViewer/bitcasaViewer.csproj	2014-01-02 04:19:10.000000000 +0900
+++ BitcasaDLL-20140105/bitcasaViewer/bitcasaViewer.csproj	2014-01-04 17:35:56.000000000 +0900
@@ -12,49 +12,50 @@
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
   </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>x64</PlatformTarget>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
     <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
+    <OutputPath>bin\x64\Debug\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
     <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>true</Prefer32Bit>
   </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
     <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>true</Prefer32Bit>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>bin\x64\Debug\</OutputPath>
+    <OutputPath>bin\x86\Debug\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <DebugType>full</DebugType>
-    <PlatformTarget>x64</PlatformTarget>
+    <PlatformTarget>x86</PlatformTarget>
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     <Prefer32Bit>true</Prefer32Bit>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
-    <OutputPath>bin\x64\Release\</OutputPath>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <Optimize>true</Optimize>
     <DebugType>pdbonly</DebugType>
-    <PlatformTarget>x64</PlatformTarget>
+    <PlatformTarget>x86</PlatformTarget>
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     <Prefer32Bit>true</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="BitcasaDLL, Version=1.0.5114.37552, Culture=neutral, processorArchitecture=AMD64">
+    <Reference Include="BitcasaDLL, Version=1.0.5117.31415, Culture=neutral, processorArchitecture=x86">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\x64\Release\BitcasaDLL.dll</HintPath>
+      <HintPath>..\bin\BitcasaDLL.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
@@ -66,10 +67,6 @@
     <Reference Include="System.Drawing" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml" />
-    <Reference Include="WebWindow, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\WebWindow\bin\x64\Release\WebWindow.dll</HintPath>
-    </Reference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="BitcasaServer.cs" />
@@ -150,6 +147,10 @@
     <WCFMetadata Include="Service References\" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>Copy "$(SolutionDir)ssl\$(PlatformName)\dll\*" "$(SolutionDir)bin"
+Copy "$(TargetPath)" "$(SolutionDir)bin"</PostBuildEvent>
+  </PropertyGroup>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/bitcasaViewer/Form1.cs BitcasaDLL-20140105/bitcasaViewer/Form1.cs
--- BitcasaDLL-20140103/bitcasaViewer/Form1.cs	2014-01-03 06:37:52.000000000 +0900
+++ BitcasaDLL-20140105/bitcasaViewer/Form1.cs	2014-01-03 17:16:38.000000000 +0900
@@ -530,6 +530,11 @@
                 {
                     if (selecttree.ShowDialog() != DialogResult.OK) return;
                     right = selecttree.SelectedPath;
+                    var item = BitcasaFileInfo.dirTree[right];
+                    if (item.mount_point.StartsWith("%%%HOME%%%/Bitcasa"))
+                    {
+                        right = "\\Bitcasa Infinite Drive" + right;
+                    }
                 }
                 if (right == "") right = "\\";
                 using (var localtree = new FolderBrowserDialog())
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/bitcasaViewer/Form1_popup.cs BitcasaDLL-20140105/bitcasaViewer/Form1_popup.cs
--- BitcasaDLL-20140103/bitcasaViewer/Form1_popup.cs	2014-01-02 12:48:24.000000000 +0900
+++ BitcasaDLL-20140105/bitcasaViewer/Form1_popup.cs	2014-01-05 00:28:04.000000000 +0900
@@ -130,6 +130,7 @@
                     catch
                     {
                         progress(0);
+                        throw;
                     }
                     toolStripStatusLabel1.Text = "";
                     ongoing = false;
@@ -198,6 +199,7 @@
                     catch
                     {
                         progress(0);
+                        throw;
                     }
                     toolStripStatusLabel1.Text = "";
                     ongoing = false;
@@ -263,6 +265,7 @@
                 catch
                 {
                     progress(0);
+                    throw;
                 }
                 toolStripStatusLabel1.Text = "";
                 ongoing = false;
diff -ruN --strip-trailing-cr BitcasaDLL-20140103/WebWindow/WebWindow.csproj BitcasaDLL-20140105/WebWindow/WebWindow.csproj
--- BitcasaDLL-20140103/WebWindow/WebWindow.csproj	2013-12-25 15:22:08.000000000 +0900
+++ BitcasaDLL-20140105/WebWindow/WebWindow.csproj	2014-01-04 17:23:48.000000000 +0900
@@ -31,6 +31,24 @@
     <ErrorReport>prompt</ErrorReport>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System.Core" />
@@ -58,6 +76,9 @@
     </EmbeddedResource>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>Copy "$(TargetPath)" "$(SolutionDir)bin"</PostBuildEvent>
+  </PropertyGroup>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">
