我使用下面的代码通过 FTP 上传文件。从第 9 行到第 14 行,它显示错误“属性'连接'对标签无效。(发现:[连接,本地文件,被动,动作,failifexists,远程文件])”请让我知道我去了哪里错误的。提前致谢
1.<cftry>
2. <cfftp connection="Myftp"
3. action="open"
4. server="#ftpurl#"
5. username="#form.ftpusername#"
6. password="#form.ftppassword#">
7. stoponerror="Yes">
8. Did it open connection? <cfoutput>#cfftp.succeeded#</cfoutput><br />
9. <cfftp connection = "Myftp"
10. action = "PutFile"
11. localFile="D:\home\\wwwroot\localfile.txt"
12. remoteFile="remotefile.txt"
13. failifexists="no"
14. passive = "Yes">
15. Did it put the file? <cfoutput>#cfftp.succeeded#</cfoutput><br />
16. <cfftp action="close" connection="Myftp">
17. <cfcatch>
18. <cfset errText = "Please enter valid FTP details" />
19. <cfset err = err + 1 />
20. </cfcatch>
21.</cftry>