FTP file upload failed.

Discussion in 'C++' started by IVISWP, Feb 20, 2013.

  1. IVISWP

    IVISWP New Member

    Joined:
    Feb 20, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    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.

    Regards
    +swapnali
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Are you able to put a file using external FTP application.

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

    IVISWP New Member

    Joined:
    Feb 20, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    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....
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    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.
     
  5. IVISWP

    IVISWP New Member

    Joined:
    Feb 20, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Thanks Shabbir, I will try that.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice