-
doesnt upload???
Code:
#include <stdio.h>
#include <wininet.h>
#include <windows.h>
void asdf(void);
int main(void)
{
asdf();
return 0;
}
void asdf(void)
{
HINTERNET hInternet;
HINTERNET hFtpSession;
hInternet = InternetOpen(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
hFtpSession = InternetConnect(hInternet,"site.com","24", "site","****************", INTERNET_SERVICE_FTP, 0,0 );
if(FtpPutFile(hFtpSession, "C:\\log.txt", "mylog.txt", FTP_TRANSFER_TYPE_BINARY, INTERNET_FLAG_PASSIVE) == TRUE){
printf("File Up!");
InternetCloseHandle(hFtpSession);
InternetCloseHandle(hInternet);
}
else
printf("nope");
}
wont upload???
-
Check the return value of each function called. If any function fails, print out the error code, usually from GetLastError().
I would also remove any tabs from your source code before posting so it's more readable.
gg