problem in CFtpConnection::OpenFile()
-
hi, i am creating a FTP application in which i have used a progress bar for showing the status of the download. for doing this i used the CFtpConnection::OpenFile() method so that i will read the data in small number of bytes and then display the status. the problem here is that when i try to open the file using this method the return value which should be in the form of a CInternetFile is being returned as a null value. hence i am not able to read the file and there is an excepetion the syntax i have used is as follows: the completePath is a CString and contains the path as ftp://homepc/test.txt i have used IIS to create a ftp site and stored some text files as well as other file in the ftp root directory try { srcFile = pftp->OpenFile(completePath, GENERIC_READ, INTERNET_FLAG_TRANSFER_BINARY, 1); } catch(CInternetException *IE) { display the exception } when i debugged the program i found out that the srcFile had nothing in it i.e it was NULL with some "?????" in the watch window. can anyone tell me why am i getting this problem or is there any other way to use the progress bar? aditya
-
hi, i am creating a FTP application in which i have used a progress bar for showing the status of the download. for doing this i used the CFtpConnection::OpenFile() method so that i will read the data in small number of bytes and then display the status. the problem here is that when i try to open the file using this method the return value which should be in the form of a CInternetFile is being returned as a null value. hence i am not able to read the file and there is an excepetion the syntax i have used is as follows: the completePath is a CString and contains the path as ftp://homepc/test.txt i have used IIS to create a ftp site and stored some text files as well as other file in the ftp root directory try { srcFile = pftp->OpenFile(completePath, GENERIC_READ, INTERNET_FLAG_TRANSFER_BINARY, 1); } catch(CInternetException *IE) { display the exception } when i debugged the program i found out that the srcFile had nothing in it i.e it was NULL with some "?????" in the watch window. can anyone tell me why am i getting this problem or is there any other way to use the progress bar? aditya
Do you have an alias for homepc set to 127.0.0.1 on your development machine? Have you checked the permissions of the file on the FTP server? Have you checked that the FTP server allows anonymous access (assuming you are not using a username and password) ? HTH.