| Dart Home | PowerTCP FTP for ActiveX | Custom Development | Reply | PowerTCP FTP for ActiveX Topics | Forums |
| Author | Forum: PowerTCP FTP for ActiveX Topic: Retrieve method does produces an empty file |
| Kazuyo From: London, United Kingdom Posts: 9 Member Since: 08/15/05 |
posted August 15, 2005 11:43 AM Hello, I have a C++ application which uses Retrieve method to get a file form a source server. This application uses DartFtp sample files (IFtp.h and IFtp.cpp). I have a question regarding Retrieve method. ------------------------------------------------------------------- p_remote_file has a string value "\server_folder\source_file.txt" p_local_file has a string value "c:\targe_foldert\retrieved_file" p_file_transfer_mode has a value 1 try { pFtp->Type = (DartFtp::TypeConstants) p_file_transfer_mode; COleVariant ov_local_file = p_local_file; pFtp->Retrieve (p_remote_file, ov_local_file, 0); } catch (_com_error comerror) { } ------------------------------------------------------------------- When the above lines are successfully executed when source_file.txt exists in the server_folder. However when the source file does not exist, Retrieve method produces a 0 byte retrieved_file in the target_folder. I have tested with two different versions of DartFtp.dll and results are different. DartFtp (2001.08.15): does NOT create an empty file in target folder. DartFtp (2003.02.28): creates an empty file in target folder. Please let me know which is the correct specification of the behaviour of Retrieve method. Not to create an empty file is preferable for me..! Thank you. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted August 15, 2005 11:49 AM Have you tried with the latest from our Website? Those are both very old versions. The current version is 1.8.2.11 and is part of the 1.8.3 setup of the FTP tool available here: http://www.dart.com/downloads/ftptool.exe |
| Kazuyo From: London, United Kingdom Posts: 9 Member Since: 08/15/05 |
posted November 4, 2005 11:43 AM Hello again! Thank you for your reply. I downloaded the latest ftptool.exe and tested with our program. The result is the latest dlls create an empty file in target folder. DartFtp.dll (1.8.2.11) DartSock.dll (2.8.2.20) Whereas our old dlls do not create an empty file in target folder. DartFtp.dll (1.6.0.0) DartSock.dll (2.2.0.0) Is there any way to solve this problem? Thank you in advance. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 6, 2005 9:23 AM Can you duplicate this problem using our sample apps? If so, please tell me the exact steps. |
| Kazuyo From: London, United Kingdom Posts: 9 Member Since: 08/15/05 |
posted November 8, 2005 12:37 PM Hello, thank you for your prompt reply. I have tested using one of your sample file. Sample: ListView Place: (local)\PowerTCP\FTP Tool\Samples\Vc6\Client\ Problem was duplicated at FtpListViewDlg.cpp(581). ------------------------------------ void CFtpListViewDlg::DoRetrieve() ... pFtp->Retrieve(_bstr_t(m_RemoteFileName), ovLocalFile, m_LocalFileSize); ... ------------------------------------ The test steps I have done are: 0. <VC++> Set breakpoint at FtpListViewDlg.cpp(581) then Start debugging 1. <On screen> Connect to FTP server 2. <On screen> Select a file to be retrieved 3. <File Explorer> Then rename the file selected to be invalid Thank you! |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 8, 2005 12:43 PM Please explain step 3. Are you saying to rename the file after the transfer starts? Please provide the exact details of what you do. |
| Kazuyo From: London, United Kingdom Posts: 9 Member Since: 08/15/05 |
posted November 8, 2005 1:02 PM Hello. I will rewrite the steps in detail. The test steps I have done are: 0. <VC++> Set breakpoint at FtpListViewDlg.cpp(581) then Start debugging 1. <On File view screen> Connect to FTP server 2. <On File view screen> Select a file to be retrieved 3. <On File view screen> Click [Actions] - [Retrieve] 4. <Save File as... screen> Select a destination folder (no files exist in the folder) 5. <Save File as... screen> Enter a new file name 6. <File Explorer> Select the file to be retrieved (as in 2) and rename it to be invalid 7. <Save File as... screen> Click [Save] 8. <Retrieving File.. screen> Click [Retrieve] 9. <VC++> Confirm that the target file is created with no data after Retrieve is called |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 8, 2005 1:35 PM Sorry, but I still can't duplicate this. I don't understand step 6: "Select the file to be retrieved (as in 2) and rename it to be invalid" How do I select the file? With what app? |
| Kazuyo From: London, United Kingdom Posts: 9 Member Since: 08/15/05 |
posted November 9, 2005 4:10 AM Regarding 6. <File Explorer> Select the file to be retrieved (as in 2) and rename it to be invalid: Basically I wanted to create a situation where there was no file to be retrieved. Therefore in step 6, I change the file name which was selected in step 2 using File Explorer (or you can rename the file using Dos command,) Then now we are in the situation: On <File view screen>, the file was selected but actuallly there was no file with the name appeared in the screen. I hope this time I have made myself clear... Thank you for your cooperation. |
| Kazuyo From: London, United Kingdom Posts: 9 Member Since: 08/15/05 |
posted November 9, 2005 11:41 AM I will explain more specific to avoid misunderstanding. I am using List View Client which can be found at Power TCP\FTP Tool\Samples\Vc6\Client\. As this sample application has a graphical interface I need to select an existing file through the window in order to continue with the retrieve process. However the behaviour we are experiencing is when the source file does not exist (and there is no user interface). So in order to mimic this situation I select/highlight the file to be retrieved in the graphical window "PowerTCP FTP Client" after successfully connected to FTP server (select [File]-[Login] on the screen). Once the file is highlighted (and therefore the name is remembered) I switch to Windows Explorer and manually rename or delete the selected file to recreate our situation. In going back to the graphical interface I am allowed to continue through the retrieve process (select [Actions] - [Retrieve]), as it does not validate the file name after the initial selection, and I am allowed to nominate a destination file and path. The program returns an error to the window, saying the system cannot find the file specified and creates an empty file at the destination. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 9, 2005 4:52 PM Ok thanks, but I still don't understand. Let's try another approach. If I understand you correctly, what you are doing is calling: Ftp1.Retrieve RemoteFileName, LocalFileName, LocalFileSize but RemoteFileName is not valid correct? If so, then I can't confirm. I just called: Ftp1.Retrive "filethatdoesnotexist", "c:\result.txt" and there was no "c:\result.txt" left over. |
| Kazuyo From: London, United Kingdom Posts: 9 Member Since: 08/15/05 |
posted November 11, 2005 7:05 AM Hi Tony, I think we are talking about the same situation. The specific line in the code is (from FtpListViewDlg.cpp) : pFtp->Retrieve(_bstr_t(m_RemoteFileName), ovLocalFile, m_LocalFileSize); and when stepping throught the debugger m_RemoteFileName = "filenamethatnolongerexists" Still this procduces the empty file on in the destination (tried with sending to desktop and c:\). I have since tried this on a colleagues machine, and we have installed the latest version of the the DartFTP.dll 1.8.2.11 and doubled checked that and the behaviour is still the same with the empty file?! Could you clarify the specified expected behaviour of the function? ie is the file expected to be present or not. Any other ideas on what could be causing the difference in behaviour? Thanks for you help (and patience!) on this one. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 11, 2005 9:35 AM Ok, I see what you mean now. I have written this up as issue #3570, but since there is a workaround (delete the local file when the error occurs) it will most likely not be given top priority. Thanks for reporting it and bearing with my slowness at understanding the problem! |
| Kazuyo From: London, United Kingdom Posts: 9 Member Since: 08/15/05 |
posted November 14, 2005 6:13 AM Thank you very much. for taking this into consideration. I'm sorry to asking you just after you have written up this issue, but do you have rough timetable in mind as to solve the problem? Also, is there any way that I can get the situation? I deeply grateful for your efforts. Thank you! |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 15, 2005 9:32 AM Please contact David Harry (sales@dart.com) to discuss resolution of the issue. |
| Kazuyo From: London, United Kingdom Posts: 9 Member Since: 08/15/05 |
posted November 15, 2005 11:11 AM Thank you, I will! |
| Reply | PowerTCP FTP for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|