[問題] FTP Server/Socket Client/RETR File
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Eclipse CDT on Windows
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
Winsock.h
問題(Question):
我最近在寫一個Socket Client的小程式,功能是連到FTP Server抓取一個檔案回來,
目前能成功logged in到FTP Server,
但是一直無法從Server上抓檔案回來
我看了很多相關範例跟文件
還是不知道問題究竟出在哪
希望能夠尋求高手協助看一段code幫小弟指點Q_Q
謝謝大家!!!
餵入的資料(Input):
arg[1] = Server IP
arg[2] = FileName
預期的正確結果(Expected Output):
透過Socket Client從FTP Server下載一個文字檔.
錯誤結果(Wrong Output):
"Server reply : 421 Local resource failure: open data port failed."
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/4PKibeiE
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 219.70.223.148
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1448889303.A.1EE.html
→
11/30 21:27, , 1F
11/30 21:27, 1F
→
11/30 21:28, , 2F
11/30 21:28, 2F
沒有耶, 不過我用cmd或其他方式去連FTP Server,都可以正常下載檔案,
但自己寫socket client就是連上Server了,卻不能下載檔案...
※ 編輯: iceberg (219.70.223.148), 11/30/2015 21:35:16
推
11/30 21:46, , 3F
11/30 21:46, 3F
是的!! 只是一般文字檔
※ 編輯: iceberg (219.70.223.148), 11/30/2015 21:59:14
推
11/30 23:38, , 4F
11/30 23:38, 4F
小弟對於這方面是新手 請問Q大有比較推薦的tool嗎?
→
11/30 23:40, , 5F
11/30 23:40, 5F
很可惜 我們使用的Server不支援passive模式,所以我只能用active模式寫client@@"
※ 編輯: iceberg (219.70.223.148), 12/01/2015 00:04:55
推
12/01 00:38, , 6F
12/01 00:38, 6F
謝謝!! 我明天早上研究一下: )
※ 編輯: iceberg (219.70.223.148), 12/01/2015 00:54:44
→
12/01 00:54, , 7F
12/01 00:54, 7F