From 83e9c71298b24099fd6956ddd6eb588a093cb3a3 Mon Sep 17 00:00:00 2001 From: bri Date: Mon, 10 Feb 2014 18:08:03 +0400 Subject: [PATCH] original file names are kept --- src/SimanIO_Link.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SimanIO_Link.cxx b/src/SimanIO_Link.cxx index dc5dfc0..2cc9779 100644 --- a/src/SimanIO_Link.cxx +++ b/src/SimanIO_Link.cxx @@ -138,6 +138,8 @@ SimanIO_Configuration SimanIO_Link::RetrieveConf() for(; aFileIter.More(); aFileIter.Next()) { string aURL = aFileIter.URL(); string aFileName = aURL.substr(aURL.find_last_of("/\\")+1); + int startUnderlineIndex = aFileName.find_first_of("_") + 1; + string aSourceFileName = aFileName.substr(startUnderlineIndex, aFileName.find_last_of(".") - startUnderlineIndex); //cout << "aURL = " << "http://" << aSimanWSHost << "/repository/" << aURL << "\n"; string aPathToVault = aResponseFilePath.substr(0, aResponseFilePath.find("download")) + "vault/"; @@ -153,7 +155,7 @@ SimanIO_Configuration SimanIO_Link::RetrieveConf() aGetFileRequest->setArgs0(aPathToVault + aURL); aGetFileResponse = aStub->getFile(aGetFileRequest); - outputStream.open((aClientFileDir + aFileName).c_str(), ofstream::binary); + outputStream.open((aClientFileDir + aSourceFileName).c_str(), ofstream::binary); int aBufferSize = axutil_base64_binary_get_decoded_binary_len(aGetFileResponse->get_return(), Environment::getEnv()); int* aBufSize = new int[aBufferSize]; unsigned char* aCopyBuffer = axutil_base64_binary_get_plain_binary(aGetFileResponse->get_return(), Environment::getEnv(), aBufSize); -- 2.39.2