Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FTPCommand - command not understood

Posted on 2004-08-12
3
Medium Priority
?
286 Views
Last Modified: 2012-06-21
I am writing a VB 6.0 app that will read commands from a file much like FTP.exe does. It will of course be using the wininet.dll. The only one I am having a problem with is the FTPCommand. Code is as follows:
Public Function SendCommand(ByVal strCommand As String) As Boolean

Dim hFile As Long

strCommand = "PUT test.txt"
If FtpCommand(hConnection, False, Me.TransferType, strCommand, 0, hFile) = False Then
ErrorOut Err.LastDllError, "SendCommand"
SendCommand = False
Exit Function
Else
SendCommand = True
End If

End Function

Where strCommand is actually read in from a file so it could be any valid FTP command.  It recognizes the "quit" command but does not allow me to perform the "PUT". Is my syntax incorrect? Please advise.
0
Comment
Question by:legna456
1 Comment
 
LVL 11

Accepted Solution

by:
lbertacco earned 200 total points
ID: 11786896
To send files, you should use FtpPutFile, not FtpCommand
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question