Hola, estoy haciendo pruebas y no lo veo claro (sorry, el visual basic no es lo mio).
La idea es subir carpetas, previa comprobación de que existan en el servidor. Cuando procedo a dicha comprobación, con la función exCarpetaFTP(), me da este error:
Código:
12018 ERROR_INTERNET_INCORRECT_HANDLE_TYPE
The type of handle supplied is incorrect for this
operation.
Código:
Function exCarpetaFTP(carpeta As String, hConnection As Long) As Boolean
' lista el contenido de un directorio
Dim hFind As Long
Dim nLastError As Long
Dim dError As Long
Dim ptr As Long
Dim pData As WIN32_FIND_DATA
'On Error Resume Next
If Len(carpeta) > 0 Then rcd (carpeta)
pData.cFileName = String(MAX_PATH, 0)
hFind = FtpFindFirstFile(hConnection, "*.*", pData, 0, 0)
nLastError = Err.LastDllError
If hFind = 0 Then
If (nLastError = ERROR_NO_MORE_FILES) Then
MsgBox "This directory is empty!"
exCarpetaFTP = False
Else
ErrorOut nLastError, "FtpFindFirstFile"
exCarpetaFTP = False
End If
Exit Function
End If
End Function
Soy medio inutil, no consigo hacer la maldita comprobación