From 2843335f6db86b67f10db999d62e5ad48b108d21 Mon Sep 17 00:00:00 2001 From: Mondo Diaz Date: Fri, 12 Dec 2025 13:53:15 -0600 Subject: [PATCH] Document curl -OJ flag for correct download filenames - Update download examples to use -OJ flag - Add note explaining curl download flags (-O, -J, -OJ, -o) - Add example for saving to a specific filename --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c536dc3..d1f06c2 100644 --- a/README.md +++ b/README.md @@ -275,14 +275,17 @@ curl -X POST http://localhost:8080/api/v1/project/my-project/releases/upload/abc ### Download an Artifact ```bash -# By tag -curl -O http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0 +# By tag (use -OJ to save with the correct filename from Content-Disposition header) +curl -OJ http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0 # By artifact ID -curl -O http://localhost:8080/api/v1/project/my-project/releases/+/artifact:a3f5d8e12b4c6789... +curl -OJ http://localhost:8080/api/v1/project/my-project/releases/+/artifact:a3f5d8e12b4c6789... # Using the short URL pattern -curl -O http://localhost:8080/project/my-project/releases/+/latest +curl -OJ http://localhost:8080/project/my-project/releases/+/latest + +# Save to a specific filename +curl -o myfile.tar.gz http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0 # Partial download (range request) curl -H "Range: bytes=0-1023" http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0 @@ -291,6 +294,12 @@ curl -H "Range: bytes=0-1023" http://localhost:8080/api/v1/project/my-project/re curl -I http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0 ``` +> **Note on curl flags:** +> - `-O` saves the file using the URL path as the filename (e.g., `latest`, `v1.0.0`) +> - `-J` tells curl to use the filename from the `Content-Disposition` header (e.g., `app-v1.0.0.tar.gz`) +> - `-OJ` combines both: download to a file using the server-provided filename +> - `-o ` saves to a specific filename you choose + ### Create a Tag ```bash