通过ftp.exe上传失败

时间:2015-07-21 21:04:16

标签: php windows ftp xampp

我在Windows上使用xampp并希望通过ftp.exe上传文件。 我创建了一个.vbs脚本来创建一个ftp.dat文件并运行ftp.exe。

<xp:label id="label1">
    <xp:this.value><![CDATA[#{javascript:compositeData.dds.getItemValueString("fl_name");}]]></xp:this.value>
</xp:label>

我将输出打印到日志文件中,给出了这个错误:

Set FS = CreateObject("Scripting.FileSystemObject")
Set FileIn = fs.OpenTextFile("C:\xampp\htdocs\ftp.dat", 2, true)
filein.WriteLine "open"
filein.WriteLine "IP"
filein.WriteLine "USER"
filein.WriteLine "PASSWORD"
filein.WriteLine "put C:\path\to\file\file.txt"
filein.WriteLine "quit"
filein.close

Set WSHShell = WScript.CreateObject("WScript.Shell")
WshShell.run "cmd /c ftp.exe -s:C:\xampp\htdocs\ftp.dat > log"

当我在命令行中运行此.vbs文件时,一切正常。 但是如果我使用exec / system运行它,我会从上面得到错误。

PHP文件:

ftp> To Connected to XXX.XXX.XXX.XXX.
open
XXX.XXX.XXX.XXX
220 hostname FTP server ready.
User (XXX.XXX.XXX.XXX:(none)): 
331 Password required for USER.

230 User USER logged in.
ftp> put C:\path\to\file\file.txt
200 PORT command successful.
553 file.txt: Permission denied.

ftp> quit
221 Goodbye. You uploaded 0 bytes and downloaded 0 bytes.

0 个答案:

没有答案