Recursive Directory Download/Upload for Putty SFTP

December 28, 2004, updated January 28, 2014
The latest version of PuTTY (0.63) has an mget and mput command for recursive upload and download. Which is ironic, because they rejected my patch because it should only do wildcard expansion. Oh well, psftp has what it needs now. Because there are security vulnerabilities fixed in older versions you should not use the version referenced by the patch below anymore.

I have had a lot of requests for recursive directory downloads and uploads with Putty's SFTP client. The current version (0.56) lacks this feature as well as wildcards. There are current plans to add in wildcard support (it's already been added for the SCP client), however, the developers don't wish to include mget and mput. So, I've just posted this patch. Just download the source, apply the patch, and you have a modified SFTP version with the new commands.

What the Patch Does and Does Not Do

  • Adds new mget and mput commands which just use existing internal commands.
  • mget and mput commands do not support restarts like the normal get and put commands.

Download the putty source, apply the patch or replace the PSFTP.C file with the this one, and compile.

Related Posts


Comment January 22, 2005 by anonymous
O.K. so I'm a retard, how do I apply the patch?
Comment January 22, 2005 by anonymous
I am using psftp for windows, how do I apply this patch?
Comment January 24, 2005 by anonymous
I know that I'm probably a major pain in your #$#, however I am having problems compiling psftp with the PSFTP.C file that you uploaded. I am receiving the following error message when I try to compile. "NMAKE : fatal error U1073: don't know how to make '..\psftp.c' Stop. Would it be possible for you to post the new compiled version? Or could you help me troubleshoot what I am doing wrong? Any help you could provide would be greatly appreciated. Sincerely, Jason
Comment February 24, 2005 by anonymous
I am also having problems compiling Putty with the PSFTP.C file posted. Please Help :-(
Comment March 1, 2005 by digitalpeer
Seriously guys- it works. Download the release version of the putty source and replace the file. Make sure you can compile the orginial to begin with.
Comment April 5, 2005 by anonymous
Following lines of "error while reading: failure", it hang up. It is totally unusable here.
Comment December 14, 2006 by anonymous
For windows, you can use free WinSCP -program. It's graphical tool so it does not work with scripts/batch.
Comment April 13, 2009 by Abhishek Dhanotia
I am using PUTTY .58 version. i am trying to send file through the Web Application. The application is hosted on a server and same server having PSFTP.exe. the problem is that if i logged in in the application server, i can able to send the file, but if i logged off to the server i am not able to send file by browser of my machine.