Hi.
I've currently been scripting a C++ dialog-based FTP Uploader (using MFC), in VS2010, following [url]
http://www.cpp-home.com/tutorials/256_1.htm[/url].
Everything worked out fine, corrected the bug on "#include "ifxinet.h"", should be afxinet..
However, there is a problem when it comes to uploading..
This is the part which refers to uploading, and which causes the error:
1 2 3 4 5 6 7
|
if(ftpConn->PutFile(m_maplocation, m_maplocation, FTP_TRANSFER_TYPE_BINARY, 10) == 0)
{
TRACE("Error uploading file: %dn", GetLastError());
MessageBox("Unable to upload file");
}
else
MessageBox("File successfully uploaded");
|
Okay, that's exactly how it was in the tutorial. Since m_maplocation doesn't exist, I thought it was probably m_filelocation, which was told to be added before (and which is the name of the file which is browsed). Compiles fine, like always, but still, "Unable to upload file".
What exactly might be the problem? Has anyone tested this code before and it's only a problem for this specific server?
I'm a beginner when it comes to programming, so please explain how to do the things you ask me to do (so that I can do them correctly and also learn).
If you need anything, please ask for it.
Thanks a lot,
Kelthar
PS: To explain the situation, in case there's a better solution, what I need is to upload a file to an FTP server, to a specific folder, and the password, server and username are already included in the source code, so that any user can use the executable and upload files without having access to "confidential" information. Since the server isn't mine, I can't create an account which can only upload to a specific folder and make it public while telling the users to use FileZilla or any other FTP client. If there's any better solution, please tell me..