KateYoak
KateYoak

Reputation: 1731

ftp download completes, but unzip says otherwise

I ran into a bizzarre error on linux:

I download a file using Net::FTP. Once get() method returns, I call the system unzip function:

   system("unzip -j $file");

the majority of the time, it looks as though the downloaded file didn't quite finish:

   error [<filepath>]:  missing 1862 bytes in zipfile

Why would something like this happen? I suppose, I can write code to wait and handle the error, but why isn't the filesystem updated when Net:FTP::get() returns?

Upvotes: 1

Views: 353

Answers (1)

KateYoak
KateYoak

Reputation: 1731

Right. Needed to set binary mode for ftp transfer.

Whatever made it decide to go ascii? I thought binary was automatic nowadays. It's not!

Upvotes: 1

Related Questions