Topic "Get problem"

Author Message
hagh
[View user's profile]

Joined: 2008-07-01
Posts: 4
I can not get the file that I am looking for and this is my code in a ASP page:
Set oFTPScriptFSO = CreateObject("Scripting.FileSystemObject")
Set oFTPScriptShell = CreateObject("WScript.Shell")
sLocalPath = "c:\Inetpub\wwwroot\ftptext\"
sFTPScript =
" option batch on
option confirm off
option transfer binary
open sftp://cab:Ei&2a$x@ftp.one.com
cd /Home/
get TEXT.TXT
close
exit
"

sFTPTempFile = "C:\Inetpub\wwwroot\Test\tttt.txt"
Set oFTPScript = oFTPScriptFSO.CreateTextFile(sFTPTempFile, True)
oFTPScript.WriteLine(sFTPScript)
oFTPScript.Close
sCmd = """C:\Program Files\WinSCP\WinSCP.com"" -script=" & sFTPTempFile
sout1 = oFTPScriptShell.run (sCmd, 1, true)
Set oFTPScript = Nothing

what is my problem?
Please let me know - Thanks
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Does it work if you execute the script separately? Can you post a log file and/or output of the script? Have you read the FAQ?
hagh
[View user's profile]

Joined: 2008-07-01
Posts: 4
Yes, I have looked at all the FAQ and No I don't have any log file. What should I log to find the problem?

My shell.run returns 1, and there is no error. I just cant get (download) my file. I can use the Winscp control panel to get that file directly, but I can't via VB script.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
So can you first try to execute the script manually, not from VB?
_________________
Martin Prikryl
hagh
[View user's profile]

Joined: 2008-07-01
Posts: 4
thanks for the reply
Yes, When I run a batch file (locally on the webserver machine) with a call to vbscirpt text file, it works. But when I run the ASP page with the same code, it doesn't work. Here are the two files that work together:

1- Batch file:
"C:\Program Files\WinSCP\WinSCP.com" -script=C:\Inetpub\wwwroot\Test\tttt.txt

2- The vbscript(tttt.txt):
option batch on
option confirm off
option transfer binary
open sftp://ca:Ei3&29a$b@ftp.one.com:22
get TEXT.TXT C:\Inetpub\wwwroot\Test\
close
exit
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Then you should read the mentioned FAQ once again. I'm pretty sure it describes your problem. Otherwise I need to see the log.
_________________
Martin Prikryl
hagh
[View user's profile]

Joined: 2008-07-01
Posts: 4
I can not open the conection. When I run the batch file from that machine, it works fine, but when I run it from webpage, using IIS server, it doesn't. The batch file works. It does other stuff, but the open conection comand doesnt work. Please tell me which log file you need so I can send it to you.
Thanks - Hamid
hamid.ghasemiyeh@gmail.com
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License