Filesize (wodSFTP / wodSFTP.NET / wodSFTPdll)
Hello,
I am using vb.net with wodsftp and I would like to know how to determine the size of a file on a sftp server.
A code example would be greatly appreciated.
Sincerely,
M. Wilson
Re: Filesize
Hi,
You can request remote server file size using GetAttributes Method. Result will be received inside Attributes Event in Size parameter.
[code]Sftp1.GetAttributes( /home/something/somefile.txt )
Private Sub Sftp1_AttributesEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.SFTP.AttributesArgs) Handles Sftp1.AttributesEvent
MsgBox(Args.Size)
End Sub[/code]
Let us know how it goes.
Regards,
Drazen
Re: Filesize
Drazen,
Thanks!
I am still slightly confused. I am new to wodsftp. So bare with me.
can I do this
dim myFileSz as sftp1.getattributes( myfile.txt )
or do I need to use listitems some how?
Much appreciated,
M. Wilson
Re: Filesize
Wilson,
Actually you should try exactly what I mention in my last post. Of course you should first connect to your SFTP server using wodSFTP.NET.
sftp1 in my example is wodSFTP.NET reference:
Dim WithEvents Sftp1 As WeOnlyDo.Client.SFTP
So you don't need to reference GetAttributes Method.
Did you try maybe wodSFTP.NET examples maybe? You can find them in component Samples folder.
Maybe they can help you to start developing with wodSFTP.NET.
Drazen