Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   FTP file upload failed. (http://www.go4expert.com/forums/ftp-file-upload-failed-t29501/)

IVISWP 20Feb2013 14:40

FTP file upload failed.
Hello All,
I am new, in this group. I came to know about this Experts group , through Google search.
I am facing issues in FTP client.
I am trying to write a new FTP client in C++ in Linux.
Able to log in at FTP server , through my C/C++ client. While uploading file (using "STOR" command) , I am getting "425 Can't build data connection", after that client successfully logs out.
I have opened socket on port 21 , on which , able to send user name and password , on success , I am sending "STOR temp.txt" command on same socket same port, it tries for some time and then gives error "425 Can't build data connection" , with no other information.

I read a good article "Concepts of FTP" on group... that is the reason I joined the group. I look forward, for not only resolving my issue , but also knowledge wise growth of mine.


shabbir 20Feb2013 14:44

Re: FTP file upload failed.
Are you able to put a file using external FTP application.

It could be that you don't have the permission to write.

IVISWP 20Feb2013 15:13

Re: FTP file upload failed.
Hi Shabbir,
thanks for the quick reply. But its not the case, my client and server are running in same domain. Previously , i was getting error "permission denied" , but it was solved , after changing folder rights on server side. as far I understood FTP, server uses 2 ports for communication , one for control and other for data transfer, but if I use to different ports actually in code, its not able to even log in... so confusion is, Should I use same port and same socket to transfer file as used for log i or should i use different ports and sockets for log in and file upload....

shabbir 20Feb2013 17:03

Re: FTP file upload failed.
I will suggest you to download filezilla and see the commands it issues to connecting to the FTP server and you should do the same as well.

IVISWP 20Feb2013 17:07

Re: FTP file upload failed.
Thanks Shabbir, I will try that.

All times are GMT +5.5. The time now is 09:13.