Solved

FTPCommand - command not understood

Posted on 2004-08-12
3
275 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
3 Comments
 
LVL 11

Accepted Solution

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
array220 challenge 8 56
create an incrementing variable name AutoHotKey 5 80
wordcount challenge 11 109
Tviruailstringtree sort multi columns on header click 1 54
A short article about a problem I had getting the GPS LocationListener working.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 …

896 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now