Teil 3
s_Line = txt_ReadLine(s_File, zaehler) 'Liest Zeilenweise die
' Datei s_File aus und übergibt Zeile an s_Line
'Eintrage mit Schleife verbinden
' HTML-Extension
Ext = Mid$(s_Line, InStrRev(s_Line, "."))
If Ext = ".html" Then
s_line_2 = "\export" & s_Line
Else
s_line_2 = s_Line
End If
'###### Pfade isolieren ##########
Ext = ""
txtServerFile = ""
txtWebPfad = ""
sPfad = Split(s_Line, "\")
For ii = 0 To UBound(sPfad)
If sPfad(ii) > "" Then
If InStrRev(sPfad(ii), ".") > 0 Then
txtServerFile = sPfad(ii)
Else
txtWebPfad = sPfad(ii)
End If
End If
Next ii
'###### Ende Pfade isolieren #####
localFile = GetLocalFileSize(App.Path & s_line_2)
test_local = (App.Path & s_line_2)
test_server = (Replace(txtServerpfad & Replace(s_Line, "\", "/"), _
"//", "/"))
'antUpload = 1 ' Nur zum testen only !!!!!
' Verzeichnis wechseln auf Server
If txtWebPfad > "" Then
antUpload = ftpChangeDir(pSocket, txtWebPfad)
If antUpload > 0 Then 'Verzeichniswechsel
AddStatus ftpGetLastStatusCode & " " & ftpGetLastStatusMsg _
'Status udn weiter
Else
AddStatus ftpGetLastStatusCode & " " & _
ftpTranslateErrorCode(ftpGetLastStatusCode) & " -> " & _
"'" & txtServerpfad & "'"
antUpload = ftpMakeDir(pSocket, txtWebPfad) 'fehlendes
' verzeichnis anlegen
If antUpload > 0 Then
antUpload = ftpChangeDir(pSocket, txtWebPfad) ' in das
' anglegte Verzeichnis wechseln
If antUpload > 0 Then
' wenn o.k. dann weiter
Else
AddStatus ftpGetLastStatusCode & " " & _
ftpTranslateErrorCode(ftpGetLastStatusCode) & " " & _
"-> '" & txtServerpfad & "'"
MsgBox "Es ist ein Serverfehler aufgetreten !"
AddStatus "## Trenne die Verbindung ! ##"
ftpQuit (pSocket)
AddStatus "## Verbindung wurde getrennt ! ##"
AddStatus ftpGetLastStatusCode & " , " & _
ftpGetLastStatusMsg
Exit Sub
End If
Else
AddStatus ftpGetLastStatusCode & " " & _
ftpTranslateErrorCode(ftpGetLastStatusCode) & " ->" & _
" '" & txtServerpfad & "'"
MsgBox "Konnte das Verzeichnis " & txtWebPfad & " nicht" & _
"anlegen !"
AddStatus "## Trenne die Verbindung ! ##"
ftpQuit (pSocket)
AddStatus "## Verbindung wurde getrennt ! ##"
AddStatus ftpGetLastStatusCode & " , " & _
ftpGetLastStatusMsg
Exit Sub
End If
End If
' kein Verzeichniswechsel nötig !
End If
ShowProgress picProgress, zaehler, 0, nCount ' Progress updaten
txtLocalFile = App.Path & s_line_2
antUpload = ftpPutFile(pSocket, txtHost, 0, txtServerFile, _
txtLocalFile) Gruss
Bobbel
|