Results 1 to 7 of 7

Thread: FTP to server

  1. #1

    FTP to server


    I have a .csv file on my local C drive which i have to FTP to the server. I have servername, Username and Password given. All i have to do is transfer the file to server.
    Since new to QTP and Vbscripting need some ideas to work on this.
    Thanks in advance.

  2. #2

  3. #3

    Re: FTP to server

    I Searched on google,


    : http://search.msdn.microsoft.com/search/...uery=FTP+Sample

    : http://www.scriptinganswers.com/foru...;PID=4545#4545


    but this helps only when u install 3rd party tool ..chilkat for example which my company does not support to install on machine. So was looking for just plain code w/o invoking any tool.
    Any ideas greatly appreciated.


  4. #4

    Re: FTP to server

    I even did a search on QA forums before posting this question, but found none. Is there a link if i am not aware of it in here.
    Yesterday nite i tried this function, but not of much help as when i run this code it keeps throwing me call or arguments does not match.

    Extern.Declare micLong, "InternetOpen" , "wininet.dll", "InternetOpenA", micString, micLong, micString, micString, micLong

    Extern.Declare micLong, "InternetConnect" , "wininet.dll", "InternetConnectA", micLong, micString, micInteger, micString, micString, micLong, micLong, micLong

    Extern.Declare micBoolean, "FtpGetFile", "wininet.dll", "FtpGetFileA", micLong, micString, micString, micBoolean, micLong, micLong, micLong

    Extern.Declare micLong, "InternetCloseHandle", "wininet.dll", "InternetCloseHandleA", micLong

    lngINet = Extern.InternetOpen( "MyFTP Control", 1, vbNullString, vbNullString, 0)

    lngINetConn = Extern.InternetConnect(lngINet, "ftp.microsoft.com", 0, "anonymous", "wally@wallyworld.com", 1, 0, 0)

    blnRC = Extern.FtpGetFile(lngINetConn, "dirmap.txt", "c:\dirmap.txt", 0, 0, 1, 0)

    MsgBox blnRc

    Extern.InternetCloseHandle lngINetConn
    Extern.InternetCloseHandle lngINet

    Any help appreciated.

  5. #5
    Senior Member
    Join Date
    Oct 2005
    London, U.K

    Re: FTP to server


    Out of interest, what exactly does this test achieve?

  6. #6
    Senior Member
    Join Date
    Apr 2002
    South Africa

    Re: FTP to server

    If FTP in a command dialog open the FTP prompt then it should be as simple as running a command line option like...
    objShell.Run "ftp -s:" & chr(34) & strFTPScriptFileName & chr(34)


  7. #7

    Re: FTP to server

    Test Achievement is put the file on the server.
    in the place of FtpGetFile i am writing FtpPutFile function. on local drive>> windows>> system32 has wininet.dll where this library has clsFTp.cls where all the function has been written. All i am doing is i am including this library and calling the required functions passing the arguments that is sufficient to put the file on the server.
    Hope i am successful in making the purpose clear.

    I believe if anyone mite previously have had experience of FTP-ing to the server. Let me know any ideas on FTP would help.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:45 PM.

Copyright BetaSoft Inc.