Predmet:Upload fajla
PreuzmiIzvorni kôd (Visual Basic):Option Explicit
Private Declare Sub Sleep Lib "kernel32.dll" _
(ByVal dwMilliseconds As Long)
Private Function UploadFile(ByVal sURL As String _
, ByVal sUserName As String _
, ByVal sPassword As String _
, ByVal sLocalFileName As String _
, ByVal sRemoteFileName As String) As Boolean
'Pessimist
UploadFile = False
With Inet1
.UserName = sUserName
.Password = sPassword
.Execute sURL, "PUT " & sLocalFileName & " " & sRemoteFileName
'Mayhaps, a better idea would be to implement
'StateChanged event handler
Do While .StillExecuting
Sleep 100
DoEvents
Loop
UploadFile = (.ResponseCode = 0)
Debug.Print .ResponseCode
End With
End Function
Private Sub cmdUpload_Click()
UploadFile "ftp://localhost", "", "", "C:\Test.txt", "/Level1/Uploaded.txt"
End Sub
Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.