-2

I am creating a PHP service where a user can download external ZIP files from another server to the server with the PHP. After download I keep getting this ZIP error stating that the file was corrupt / multi-part. That's not the case. I can't extract it on the linux server but when I copy it over to my OSX machine it extracts flawlessly when I double click on the archive but the terminal unzip command gives the same error. I'm confused:

Archive:  pdbeUpload.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.

Here's the link to the file (140MB):

ftp://ftp.ebi.ac.uk/pub/databases/emdb/structures/EMD-2754/map/emd_2754.map.gz

Remember, my aim is to automate the download process, so I need to get to understand why this fails.

Here's what I'm getting with gunzip:

gunzip pdbeUpload.zip 
gzip: pdbeUpload.zip: unknown suffix -- ignored

And for bunzip2, to be complete:

bunzip2: pdbeUpload.zip is not a bzip2 file.
El Dude
  • 5,328
  • 11
  • 54
  • 101

1 Answers1

4

That's a gzip archive, not zip. Use gunzip.

Wintermute
  • 42,983
  • 5
  • 77
  • 80
  • Thanks, that helped. I will notify the file provider that they should rename their files to gz. – El Dude Feb 10 '15 at 22:24
  • In the link, it is called `emd_2754.map.gz`. I can't tell you where it got renamed to `.zip`. You can unpack gzip files with a .zip extension with `gunzip -S .zip foo.zip`, but it'd be better to have the file with a correct filename extension. You could also use something like [atool](http://www.nongnu.org/atool/) that handles different archive formats. – Wintermute Feb 10 '15 at 22:33
  • Not sure what happened that it became a zip, I'll look into it further. Thanks for your input though. – El Dude Feb 10 '15 at 22:44