Beliaev Maksim
Beliaev Maksim

Reputation: 1597

Get folder size (archive size) from JFrog Artifactory

I need to download artifact folder from JFrog. Using REST API I was able to generate ZIP. However there is no header with 'Content-Length'. How can extract size of specific folder or archive ?

PS When I click download in UI I am able to see the size download folder zip size

Upvotes: 2

Views: 6475

Answers (2)

RafalS
RafalS

Reputation: 6344

I just found one hidden way to do that (there must be a better way, this is just a workaround). Go to artifactory web ui, open tree view, right-click on the folder and download. It will either tell you the folder size right away like this "Folder dir's size(19834.09077835083MB) exceeds the max allowed download size(1024MB)" or start the download, and you get the size anyway.

Upvotes: 0

Eldad Assis
Eldad Assis

Reputation: 11045

You can get a file size using the File List REST API call.

If you call this API on a single file, you'll get its info in a json format that also includes the size. Here, jq is your friend :-)

curl -s -u admin:password  "https://my.jfrog.io/artifactory/api/storage/generic-local/my.zip" | jq '.size'

Upvotes: 4

Related Questions