我使用下面的代碼通過FTP上傳文件。從第9行到第14行,顯示錯誤:「屬性'連接'對標籤無效(發現:[connection,localfile,passive,action,failifexists,remotefile])」請讓我知道我去了哪裏錯誤。在此先感謝如何在coldfusion中通過FTP上傳文件
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>
我看不出什麼錯,立即與你發佈的代碼。你正在運行哪個版本的ColdFusion? – barnyr 2013-02-26 09:46:01
我正在使用Coldfusion版本8 – RajVish 2013-02-26 09:50:19
您使用的是CF8還是CF8.0.1?你試過把它拿出來嗎?只有在動作=「打開」或「關閉」時才需要。 – Travis 2013-02-26 10:45:25