I am writing a ftp uploader file in c++ and i cant figure out how to login to the ftp server with the file without putting my password into the code. Here is my code:
void UploadFTP(string uploadFile) {
ofstream ftpFile;
ftpFile.open("ftpcmd.dat", ios_base::app);
ftpFile << "user <USER>\n";
ftpFile << "<PASSWORD>\n";
ftpFile << "bin\n";
ftpFile << "put " + uploadFile + "\n";
ftpFile << "quit";
ftpFile.close();
system("ftp -n -s:ftpcmd.dat <FTPSERVER>");
remove("ftpcmd.dat");
}
how do i put the login credentials into where it says <PASSWORD>
without actually putting my password there.
Also if i could get any tips on the line where it says system("ftp -n -s:ftpcmd.dat <FTPSERVER>");
I would like to try to move away from the system command.