Sub upload
SQLDataBasePath = xui.DefaultFolder
fl = txtcognome.Text.Trim & txtnome.Text.Trim
testo= "nomefiledb.rsd"
If File.Exists(SQLDataBasePath,testo) Then
ftp.Initialize("ftp", "ftp.miosito.it", 21, "*******@aruba.it", "*******")
ftp.PassiveMode = True
If RadioB1.Checked=True Then
'tipo di professionista
Dim sf As Object = ftp.UploadFile(SQLDataBasePath,testo,True,"miosito.it/public/miacartella1/" & fl & testo)
Else
'altro tiop di professionista
Dim sf As Object = ftp.UploadFile(SQLDataBasePath,testo,True,"myosito.it/public/miacartella2/" & fl & testo)
End If
Wait For (sf) ftp_UploadCompleted (ServerPath As String, Success As Boolean)
If Success Then
ToastMessageShow("il file **** è stato salvato sul server",False)
Sleep(1000)
Else
ToastMessageShow("Error uploading file****", False)
End If
ftp.Close
End Sub
Sub download
SQLDataBasePath = xui.DefaultFolder
fl = txtcognome.Text.Trim & txtnome.Text.Trim
testo= "nomefiledb.rsd"
testo1= fl & testo
If File.Exists(SQLDataBasePath, "nomefiledb.rsd") Then
File.Delete(SQLDataBasePath, "nomefiledb.rsd")
End If
Sleep(1000)
ftp.Initialize("ftp", "ftp.miosito.it", 21, "*****@aruba.it", "*******")
ftp.PassiveMode = True
If RadioB1.Checked=True Then
Dim sf As Object = ftp.DownloadFile("miosito.it/public/miacartealla1" & testo1,True, SQLDataBasePath, testo)
Else
Dim sf As Object = ftp.DownloadFile("miosito.it/public/miacartella2/" & testo1,True, SQLDataBasePath, testo)
End If
Wait For (sf) ftp_DownloadCompleted(ServerPath As String, Success As Boolean)
If Success Then
ToastMessageShow ("File ****** ripristinato",False)
Sleep(1000)
ftp.close
End Sub