in reply to FTP: Unable to close datastream

First, thank you for taking the time to read the posting FAQs so that your question is clear. OK, now to your problem. I think the 'unable to close datastream' is a red-herring. The message before that indicates that the transfer timed out. It's not clear from the debug output how much time passed between when the transfer started and when it reported a timeout. Here is what I would try:
  1. Make sure you can execute these commands using a manual ftp client.
  2. If the file transfers manually, but the connection is slow, you can bump the timeout up. It defaults to 120 seconds
  3. Do you have to use passive mode? Will it work in active?
  4. If you have permission, turn up debugging on the ftp server. It might give you more info on what is failing


Replies are listed 'Best First'.
Re^2: FTP: Unable to close datastream
by m0uthless (Initiate) on Feb 19, 2013 at 22:07 UTC

    Thx for the reply.

    1) with ftp client works, and this script also works with smaller files but not with big ones (> 1 gb)

    2) First of all the downloaded file even with the error is ok. I tried to increase the timeout, but for example if i set 1000 seconds even if the download it's already finished the procedure wait 1000 seconds and then throws the error.

    3) If I disable passive mode when I run the script it stops at $ftp->dir() (if i run it on windows 7 it works well even in active mode);

    4) It doesn't seems there is an advanced debug/log in filezilla server, but to the server the transfer results finished and successfully (226 Transfer OK)

    Thanks, Logan