ERROR to UPLOAD IMAGE TO FTP SERVER USING c++

hello everyone in this website .I'm have written a program to send an image(123.jpg) to ftp server using my account .
but the image doesn't appear into ftp server .how can i fix it.
this is my code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <windows.h>
#include <wininet.h>
#include <iostream.h>
#include <stdio.h>
#pragma comment(lib, "wininet.lib")
int upload(char *server, char *user, char *pass, char *localF, char *remoteF)
   {    
       HINTERNET hInternet;
       HINTERNET hFtpSession;
       hInternet = InternetOpen(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
      hFtpSession = InternetConnect(hInternet,server,INTERNET_DEFAULT_FTP_PORT, user,pass,INTERNET_SERVICE_FTP, 0,0 );
       if(FtpPutFile(hFtpSession, localF, remoteF, FTP_TRANSFER_TYPE_BINARY, 0))
           {
           return 0;
           } else {
           return -1;
           }
 
       InternetCloseHandle(hFtpSession);
       InternetCloseHandle(hInternet);
 
   }
int main()
{
if(upload("url ftp server ", "username", "password", "C:\\123.jpg","mypic.jpg")) {
    cout<<"File %s uploaded\n";
      } 
      else {
      cout<<"File %s failed\n";
    //FileSubmit();
    system("pause");
    return 0;
                  }
}
Topic archived. No new replies allowed.