0

I want to download package from Artifactory. If I download it manually from Artifactory UI, and transfer that file to Linux server (RHEL 8) I can see that file is in proper ZIP format:

file arena-web.zip
arena-web.zip: Zip archive data, at least v2.0 to extract

If I try to download it using the CURL from the same Linux server, I get the file as ASCII text which I cannot unzip of course (and that is the my main issue)

file arena-web.zip
arena-web.zip: ASCII text

curl command which I used:

 curl -u "user:pass" -O https://artifactory_my_domain/packages/arena-web.zip

I tried with -L and -o options as well.

Is this some sort of a bug or what can be the issue?

Update - content of the "text file version":

{
  "repo" : "uueaw-generic-snapshot-local",
  "path" : "/packages/arena-web.zip",
  "created" : "2022-01-13T13:53:49.152Z",
  "createdBy" : "svcacct",
  "lastModified" : "2022-01-13T13:53:48.973Z",
  "modifiedBy" : "svcacct",
  "lastUpdated" : "2022-01-13T13:53:49.153Z",
  "downloadUri" : "https://artifactory_mydomain/artifactory/uueaw-generic-snapshot-local/packages/arena-web.zip",
  "mimeType" : "application/zip",
  "size" : "5412051",
  "checksums" : {
    "sha1" : "6e5069ee60b1977ad13ddf45a30c12c5fd1d8719",
    "md5" : "46fa87adefe864b13bb2216801d246b1",
    "sha256" : "a08361f71ec483044f675af07ff8ca214dc2f17a9510c2a626ed57e04670cbfb"
  },
  "originalChecksums" : {
    "sha1" : "6e5069ee60b1977ad13ddf45a30c12c5fd1d8719",
    "md5" : "46fa87adefe864b13bb2216801d246b1",
    "sha256" : "a08361f71ec483044f675af07ff8ca214dc2f17a9510c2a626ed57e04670cbfb"
  },
  "uri" : "https://artifactory_my_domain/artifactory/api/storage/uueaw-generic-snapshot-local/packages/arena-web.zip"
}
7
  • 2
    What are the contents of the text file version? That should give a clue as to what the issue is. Jan 14, 2022 at 18:15
  • 2
    Chances are that the server wants to set a cookie or execute some javascript, and what you're getting is some HTML intended to inform a human of what to do. Look at the content of the file. Jan 14, 2022 at 18:16
  • @L.ScottJohnson and Gilless I updated the question with the content. Can you conclude something based on this? Thanks a lot
    – AndreyS
    Jan 14, 2022 at 19:51
  • 1
    It looks as if what you want to get is actually what's in the value of the top-level uri (or downloadUri) key.
    – Kusalananda
    Jan 14, 2022 at 20:02
  • 1
    ah, that seems to be some kind of download descriptor, not what you originally wanted to download. Try jsut downloading the downloadUri URI. Jan 14, 2022 at 20:02

1 Answer 1

0

file is also just human; it might simply be wrong. (it uses heuristics, nothing can guarantee that not some other file format gets wrongly interpreted)

If not:

A zipfile can perfectly well start with something that is valid ASCII text; that's a result of the lenient definition of the file format.

This leads to the existence of so-called file-format polyglots, i.e. files that are valid as multiple files. A common example is The International Journal of PoC||GTFO, whose PDF files usually double as valid ZIP, windows execuatble, as bootable disk image, game console ROM image, music file, and combinations of these.

For more examples of Polyglots, Ange Albertini has excellent talks on the subject, and his github account harbors a lot of examples for zip polyglots and variants; this one is a ZIP (a JAR, which is ZIP with a Java .class inside), that's also a Python script (so, starts with ASCII text), a Windows Executable, and a PDF. Why? Because.

1
  • Thanks but this does not resolve my issue. I simply cannot unzip that zip file which is the main reason why I am generating this issue. I mentioned that in my question - I cannot unzip that file if that is the case - so what is the solution??? Unzip output: Archive:arena-web 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. unzip: cannot find zipfile directory in one of arena-web.zip
    – AndreyS
    Jan 14, 2022 at 19:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .