diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index f6c740253..83e2ec2e8 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -735,7 +735,16 @@ bool ftController::FileRequest(std::string fname, std::string hash, { RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ - savepath = mPartialsPath + "/" + hash; + /* extension added to partial name to made + * possible preview of partial files from gui */ + std::string ext = ""; + int pos = fname.find_last_of('.'); + if (pos > 0) /* don't apply for hidden files with no extension */ + { + ext = fname.substr(pos); + } + + savepath = mPartialsPath + "/" + hash + ext; destination = dest + "/" + fname; /* if no destpath - send to download directory */