Get remote file properties (FTP)
-
am working on FTP wizard I written a code to get the properties of selected file for local drive as HTREEITEM hlocalselitem = m_LocaleTreeCtrl.GetSelectedItem(); { CString selectedPath =GetLocalTreePath (hlocalselitem); HWND hwnd = GetSafeHwnd(); SHELLEXECUTEINFO ShExecInfo = {0}; ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExecInfo.fMask = SEE_MASK_INVOKEIDLIST ; ShExecInfo.hwnd = hwnd; ShExecInfo.lpVerb = "properties"; ShExecInfo.lpFile = selectedPath; ShExecInfo.lpParameters = ""; ShExecInfo.lpDirectory = NULL; ShExecInfo.nShow = SW_SHOW; ShExecInfo.hInstApp = NULL; ShellExecuteEx(&ShExecInfo); } which works fine. But when I used it for remote file i.e. selectedpath is different as i.e. using '/' but it is giving me error as please check the path I also tried for complete URL then it gives invalid parameter for ShExecInfo.lpFile = selectedPath; path is : "ftp://www.ganitra.com//BannerTestPlan.jpg"
-
am working on FTP wizard I written a code to get the properties of selected file for local drive as HTREEITEM hlocalselitem = m_LocaleTreeCtrl.GetSelectedItem(); { CString selectedPath =GetLocalTreePath (hlocalselitem); HWND hwnd = GetSafeHwnd(); SHELLEXECUTEINFO ShExecInfo = {0}; ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExecInfo.fMask = SEE_MASK_INVOKEIDLIST ; ShExecInfo.hwnd = hwnd; ShExecInfo.lpVerb = "properties"; ShExecInfo.lpFile = selectedPath; ShExecInfo.lpParameters = ""; ShExecInfo.lpDirectory = NULL; ShExecInfo.nShow = SW_SHOW; ShExecInfo.hInstApp = NULL; ShellExecuteEx(&ShExecInfo); } which works fine. But when I used it for remote file i.e. selectedpath is different as i.e. using '/' but it is giving me error as please check the path I also tried for complete URL then it gives invalid parameter for ShExecInfo.lpFile = selectedPath; path is : "ftp://www.ganitra.com//BannerTestPlan.jpg"
For <insert deity of choice>'s sake - it was only half an hour since your last request, in a different thread!! This is a volunteer site with people who do other things for a living. Be patient. And don't open a duplicate thread. <end lecture on forum etiquette>
chetanjoshi9 wrote:
path is : "ftp://www.ganitra.com//BannerTestPlan.jpg"
anyway, you don't need double slashes (//) if it is a forward slash. Doubles slashes are only needed in the string if you use a backward slash i.e. use either
"ftp:/www.ganitra.com/BannerTestPlan.jpg"
or"ftp:\\www.ganitra.com\\BannerTestPlan.jpg"
Technically, Windows uses the backward slash although some of the APIs will accept forward slashes. I don't know off-hand if the one you're trying to use accepts / so try changing to \\. Judy