Click here to Skip to main content
15,912,021 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Who to make a package ? Pin
Suresh H21-Feb-07 22:15
Suresh H21-Feb-07 22:15 
GeneralRe: Who to make a package ? Pin
toxcct21-Feb-07 22:18
toxcct21-Feb-07 22:18 
AnswerRe: Who to make a package ? Pin
Hamid_RT22-Feb-07 0:20
Hamid_RT22-Feb-07 0:20 
QuestionRe: Who to make a package ? Pin
David Crow22-Feb-07 2:37
David Crow22-Feb-07 2:37 
AnswerRe: Who to make a package ? Pin
Mark Salsbery22-Feb-07 5:50
Mark Salsbery22-Feb-07 5:50 
QuestionMS Speech SDK: No sound can be heard while a .wav file being processed? Pin
chocm21-Feb-07 21:10
chocm21-Feb-07 21:10 
GeneralRe: MS Speech SDK: No sound can be heard while a .wav file being processed? Pin
Programm3r22-Feb-07 3:08
Programm3r22-Feb-07 3:08 
QuestionProblem with FTP application [modified] Pin
Sameer_Thakur21-Feb-07 20:03
Sameer_Thakur21-Feb-07 20:03 
Hi all
I am working on a FTP based application in which I am trying to download a file from server.
I used CInternetSession class object for session and CFtpConnection class pointer to establish a connection to the server.
The connection is established successfully but when I tried to download the file by using GetFile() function from CFtpConnection class, it returns 0, i.e. it fails.
I used GetLastError() and InternetGetLastResponseInfo() to find out the exact reason behind it. And error message that I got says that the file that I have specified for downloading is not present on the server (error code 12003). But I can confirm its presence on specified path by typing the same url in the IE which shows me the file contents in the browser.

I could be the reason behind “No such file or directory” error?


I am using a Non-Microsoft FTP server. Will it cause any problem to download a file from Non-Microsoft FTP server with WinInet APIs?
Here I am posting a code snippet which I am using to download a file...

///////////////////////////////////////////////////////////////////////////

BOOL bRetVal = FALSE;

CInternetSession sesion;
CFtpConnection *mFtpObj = NULL;
CString strCopyAt;

CString strHost,strUserID,strPassword,strPort,strXMLFilePath;

try
{
strHost = "*******";
strUserID = "***";
strPassword = "******";
strPort = "**";
strXMLFilePath = "***/ABC.xml";

}
catch(...)
{
return FALSE;
}

int nPort = atoi(strPort);

try
{
mFtpObj = sesion.GetFtpConnection(strHost,strUserID,strPassword,nPort);
}

catch(...)
{
return FALSE;
}

// Copy the file from server with temp name.
strCopyAt = "c:\Temp_ABC.xml"

bRetVal = mFtpObj->GetFile(
strXMLFilePath,
strCopyAt,
FALSE,
FILE_ATTRIBUTE_NORMAL,
FTP_TRANSFER_TYPE_BINARY
);

DWORD wrd = GetLastError();
DWORD len = 1000;

char errorMsg[1000];
bool b = InternetGetLastResponseInfo(&wrd,errorMsg,&len);



///////////////////////////////////////////////////////////////////////////


This is the error message that I get for string errorMsg;

{"200 Type set to I
200 PORT command successful
550 *****/ABC.xml: No such file or directory
550 *****/ABC.xml: No such file or directory
"}

Thanks






-- modified at 5:51 Thursday 22nd February, 2007

Sameer Thakur

GeneralRe: Problem with FTP application Pin
Programm3r21-Feb-07 20:33
Programm3r21-Feb-07 20:33 
GeneralRe: Problem with FTP application Pin
Sameer_Thakur21-Feb-07 23:32
Sameer_Thakur21-Feb-07 23:32 
AnswerRe: Problem with FTP application Pin
David Crow22-Feb-07 2:39
David Crow22-Feb-07 2:39 
GeneralRe: Problem with FTP application Pin
Programm3r22-Feb-07 2:46
Programm3r22-Feb-07 2:46 
GeneralRe: Problem with FTP application Pin
David Crow22-Feb-07 2:53
David Crow22-Feb-07 2:53 
GeneralRe: Problem with FTP application Pin
Programm3r22-Feb-07 3:01
Programm3r22-Feb-07 3:01 
GeneralRe: Problem with FTP application Pin
JudyL_MD22-Feb-07 8:04
JudyL_MD22-Feb-07 8:04 
AnswerRe: Problem with FTP application Pin
Programm3r22-Feb-07 2:49
Programm3r22-Feb-07 2:49 
QuestionRe: Compile any projects through a project in a workspace Pin
dungpapai21-Feb-07 19:50
dungpapai21-Feb-07 19:50 
AnswerRe: Compile any projects through a project in a workspace Pin
prasad_som21-Feb-07 20:06
prasad_som21-Feb-07 20:06 
GeneralRe: Compile any projects through a project in a workspace Pin
dungpapai21-Feb-07 21:25
dungpapai21-Feb-07 21:25 
AnswerRe: Compile any projects through a project in a workspace Pin
prasad_som21-Feb-07 21:38
prasad_som21-Feb-07 21:38 
GeneralRe: Compile any projects through a project in a workspace Pin
dungpapai21-Feb-07 22:21
dungpapai21-Feb-07 22:21 
QuestionShellAbout() Question Pin
Programm3r21-Feb-07 18:54
Programm3r21-Feb-07 18:54 
AnswerRe: ShellAbout() Question Pin
prasad_som21-Feb-07 19:13
prasad_som21-Feb-07 19:13 
GeneralRe: ShellAbout() Question Pin
Programm3r21-Feb-07 19:16
Programm3r21-Feb-07 19:16 
QuestionHow to clear DC content? Pin
houari_id21-Feb-07 18:00
houari_id21-Feb-07 18:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.