Thank you for reply, all work fine!
- abellos
Session.PutFile
throws an exception on error:
If Session.Opened Then
Try
CONN.Open("Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & PercorsoDB)
SQL = "SELECT percorso, nomefile, est FROM gestioneIMG WHERE Invio >= 44866 and Invio <= 44870"
RS.Open(SQL, CONN, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
' Upload files
Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Binary
While Not RS.EOF
nomePdf = RS("nomefile").Value.ToString & "." & RS("est").Value.ToString
Percorsopdf = RS("percorso").Value.ToString & nomePdf
PercorsoRemoto = "/test/08439/upload_scansioni/F01/ORIGINAL/"
If Not Session.FileExists(PercorsoRemoto) Then
Session.CreateDirectory(PercorsoRemoto)
End If
StreamFile = File.OpenRead(Percorsopdf)
Session.PutFile(StreamFile, PercorsoRemoto & nomePdf, transferOptions)
txt.Text = txt.Text & vbCrLf & "caricamento" & nomePdf
RS.MoveNext()
End While
RS.Close()
RS = Nothing
CONN.Close()
CONN = Nothing
MsgBox("File caricati")
Catch exc As Exception
MsgBox("Errore" & exc.Message)
End Try
Else
MsgBox("session chiusa")
End If
PutFiles
there is the TransferOperationResult
class, for single file there is some similar?