how to upload a file on a server at a perticular location?
-
Hello to all, right now i am trying to upload a file on the server in VC++(MFC), currently i can upload a file directly on the server but i want to upload a file in a perticular folder on the server that i am unable to do, bcoz whenever i add that folder name to the our server address in the code then after execution i get a message "server name or address can not be resolved" and so connetion with server can not be done. I am using CInternetSession and CFtpConnection classes and GetFtpConnection(),PutFile() and GetFile() functions of these classes for uploading and downloading. can anybody help me? Anay Kulkarni
-
Hello to all, right now i am trying to upload a file on the server in VC++(MFC), currently i can upload a file directly on the server but i want to upload a file in a perticular folder on the server that i am unable to do, bcoz whenever i add that folder name to the our server address in the code then after execution i get a message "server name or address can not be resolved" and so connetion with server can not be done. I am using CInternetSession and CFtpConnection classes and GetFtpConnection(),PutFile() and GetFile() functions of these classes for uploading and downloading. can anybody help me? Anay Kulkarni
I believe you should add it to the 'pstrRemoteFile' parameter of the PutFile() / GetFile() calls instead of to the server address. Instead of asking for myfile.txt ask for subdir1/subdir2/myfile.txt See if that works for you.
-
I believe you should add it to the 'pstrRemoteFile' parameter of the PutFile() / GetFile() calls instead of to the server address. Instead of asking for myfile.txt ask for subdir1/subdir2/myfile.txt See if that works for you.
yes, it worked fine. thanks a lot sir. Anay
-
Hello to all, right now i am trying to upload a file on the server in VC++(MFC), currently i can upload a file directly on the server but i want to upload a file in a perticular folder on the server that i am unable to do, bcoz whenever i add that folder name to the our server address in the code then after execution i get a message "server name or address can not be resolved" and so connetion with server can not be done. I am using CInternetSession and CFtpConnection classes and GetFtpConnection(),PutFile() and GetFile() functions of these classes for uploading and downloading. can anybody help me? Anay Kulkarni
Are you calling the connection's
SetCurrentDirectory()
method beforePutFile()
?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne