Thread: doesnt upload???

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    38

    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???
    Last edited by me77; 05-03-2008 at 04:48 PM.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. upload / download speeds
    By Dino in forum Tech Board
    Replies: 20
    Last Post: 11-25-2008, 09:06 PM
  2. File Upload with libcurl
    By Tonto in forum Networking/Device Communication
    Replies: 4
    Last Post: 03-15-2006, 06:11 PM
  3. Upload Your Best games here!
    By Stan100 in forum Game Programming
    Replies: 41
    Last Post: 01-10-2003, 02:09 PM
  4. Anyone know a good file upload routine.
    By bjdea1 in forum C Programming
    Replies: 2
    Last Post: 12-08-2001, 12:04 PM