get only the first line without download the whole file?

Advertisement

Flendi77
Joined:
Posts:
1

get only the first line without download the whole file?

Is it possible to read only one line per ftp without first downloading the whole file with c#?
With fluentFtp I did that by opening a stream and reading a line and then sending an ABOR command.
But WinScp does not support streams. Does anyone have another idea?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,415
Location:
Prague, Czechia

Re: get only the first line without download the whole file?

You can handle Session.FileTransferProgress event and set FileTransferProgressEventArgs.Cancel to abort the transfer once you download sufficient data.
https://winscp.net/eng/docs/library_session_filetransferprogress
https://winscp.net/eng/docs/library_filetransferprogresseventargs

A request for streaming interface is tracked here:
https://winscp.net/tracker/1738

Reply with quote

Advertisement

You can post new topics in this forum