curl / Mailing Lists / curl-library / Single Mail


SFTP Write/Read Callback mechanism

From: Krishnaraj <>
Date: Sun, 13 Aug 2017 20:50:05 +0530

Hi Guys,

I am using libcurl 7.44.0 in one application to upload to and download
files from SFTP server. I am refering the procedure from ftpget.c and
ftpupload.c samples. What will be memory requirements for
upload/download. I am asking this because the size of the files is not
known prior before calling curl API. In ftpget example, I could see that
in write callback the buffer is written to the file directly. Does it
mean that curl internally allocates memory for the complete file and the
callback gets triggered after obtaining complete file from remote server ?

Thanks & Regards,
*Krishnaraj D*

"Disclaimer: This message is being sent from Kalki Communication Technologies
Pvt Ltd (KALKITECH). and may contain information which is confidential or

privileged. If you are not the intended recipient, please advise the sender
immediately by reply e-mail and delete this message and any attachments

without retaining a copy. Any unauthorized use of the content of this message
can expose the responsible party to civil and/or criminal penalties,

and may constitute a more serious offense. Further the company does not accept
liability for any errors, omissions, viruses or computer problems

experienced as a result of this transmission. If you have received this
message in error, notice is hereby given that no representation, contract or

other binding obligation shall be created by this e-mail."

Received on 2017-08-13