17

This is ASP classic, not .Net. We have to get a way to SFTP into a server to upload and download a couple of files, kicked off by a user.

What have other people used to do SFTP in ASP classic? Not necessarily opposed to purchasing a control.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Matt Dawdy
  • 19,247
  • 18
  • 66
  • 91

6 Answers6

8

If you have the ability to use WScript.Shell then you can just execute pscp.exe from the Putty package. Obviously this is less then ideal but it will get the job done and let you use SCP/SFTP in classic ASP.

John Downey
  • 13,854
  • 5
  • 37
  • 33
  • scp is different from sftp - but both are pretty secure. putty includes psftp.exe. – AJ. Sep 24 '08 at 11:13
3

The way I have done this is to create a command script file and pass this on the command line via the /b command to psftp.exe. I have also tried this in Perl and have yet to find a neater way of doing it.

There is an issue with this method, in that you already have to have accepted the RSA finger-print. If not, then the script will either wait for user input to accept it or will skip over it if you are running in full batch mode, with a failure. Also, if the server changes so that it's RSA finger-print changes (e.g. a cluster) then you need to re-accept the finger-print again.

Not an ideal method, but the only one I know.

I shall be watching this question incase anyone knows another way.

Xetius
  • 44,755
  • 24
  • 88
  • 123
2

There is an issue with this method, in that you already have to have accepted the RSA finger-print. If not, then the script will either wait for user input to accept it or will skip over it if you are running in full batch mode, with a failure. Also, if the server changes so that it's RSA finger-print changes (e.g. a cluster) then you need to re-accept the finger-print again.

1

I've previously used a component from here: www.weonlydo.com. I didn't find it the easiest piece of kit to develop against but it got the job done in a hurry.

jammus
  • 2,540
  • 23
  • 28
1

I used to do that with FTP on Windows (create a file of commands and shell out FTP.exe).

halfer
  • 19,824
  • 17
  • 99
  • 186
Matt Dawdy
  • 19,247
  • 18
  • 66
  • 91
0

December 2020 :

  • ASP is dead, it has been superseded by ASP .Net 18 years ago.
  • At this time, the most common way to use SFTP in .Net is to use the SSH.NET NuGet package.

Maybe this question should be closed ?

  • This question was asked 12 years ago and has 6 submitted answers with one of them being accepted. – GoodJuJu Dec 12 '20 at 22:35
  • Why would this be closed? Do you think that there are literally NO classic ASP webapps in use? You'd be surprised. Don't assume that there isn't old code that runs, and is rock solid, that is 20, 30, or even more years old. Experienced devs know that if it isn't broken, don't fix it. I've seen apps written in VB3 that are STILL in use right now. Because they work. – Matt Dawdy Apr 22 '21 at 20:52