mlh
April 27th, 2006, 03:59 PM
Hi everyone,
This is also posted elsewhere on this site, I hope I am not breaking any rules. To follow the guidelines. This might be a paid job (it might also just take someone 10 min). It is short term. See below.
I should start out by saying, I do not know ANY C++, I have to modifiy someone else's code, to upload a file over https to a php script on the webserver.
This works now by using FTP. I have the code that does this below
int UploadFile(const char *serverName, const char* localFile, const char* remoteFile)
{
int error = 0;
CFtpConnection *ftp = NULL;
BOOL ok;
try {
CInternetSession session(_T("Upload/1.0"));
ftp = session.GetFtpConnection(serverName, "user", "pass");
ok = ftp->SetCurrentDirectory(_T("data"));
if (ok) {
ok = ftp->PutFile(localFile, remoteFile, FTP_TRANSFER_TYPE_ASCII);
}
if (!ok) {
error = GetLastError();
}
}
catch (CInternetException* exc) {
error = GetLastError();
}
// if the connection is open, close it
if (ftp != NULL) {
ftp->Close();
}
delete ftp;
return error;
}
So my question, is can someone write in a drop in replacement code for this. You can hardcode the URL in the code. I am using vb.net C++.
As I really don't know what I am doing, I am willing to pay for someone to do this, let me know and we can work out a price.
Thank you,
Mike
This is also posted elsewhere on this site, I hope I am not breaking any rules. To follow the guidelines. This might be a paid job (it might also just take someone 10 min). It is short term. See below.
I should start out by saying, I do not know ANY C++, I have to modifiy someone else's code, to upload a file over https to a php script on the webserver.
This works now by using FTP. I have the code that does this below
int UploadFile(const char *serverName, const char* localFile, const char* remoteFile)
{
int error = 0;
CFtpConnection *ftp = NULL;
BOOL ok;
try {
CInternetSession session(_T("Upload/1.0"));
ftp = session.GetFtpConnection(serverName, "user", "pass");
ok = ftp->SetCurrentDirectory(_T("data"));
if (ok) {
ok = ftp->PutFile(localFile, remoteFile, FTP_TRANSFER_TYPE_ASCII);
}
if (!ok) {
error = GetLastError();
}
}
catch (CInternetException* exc) {
error = GetLastError();
}
// if the connection is open, close it
if (ftp != NULL) {
ftp->Close();
}
delete ftp;
return error;
}
So my question, is can someone write in a drop in replacement code for this. You can hardcode the URL in the code. I am using vb.net C++.
As I really don't know what I am doing, I am willing to pay for someone to do this, let me know and we can work out a price.
Thank you,
Mike