You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UFAL/Download instructions for command line don't work #1210
After thorough investigation, this approach is not viable. Here's why:
Problem 1: Raw (non-encoded) filenames in {} produce invalid HTTP requests
Filenames with spaces, diacritics, or special characters (Médiá (3).jfif) placed directly in {} result in curl sending raw bytes in the URL path. This violates HTTP spec (RFC 7230) — the server returns 400 Bad Request.
If you are trying to use this CURL on windows you must have the right encoding in you terminal.
You find it out using the command chcp
Problem 2: Percent-encoded filenames in {} produce wrong output filenames
The #1 variable is substituted with the literal text from {} — including percent sequences. The file is saved as M%C3%A9di%C3%A1.jfif instead of Médiá.jfif. curl does not URL-decode #1. From the official documentation: "curl does not attempt to decode %-sequences (yet) in the provided file name". There is no --url-decode or similar option.
Problem 3: -J (Content-Disposition) fails on Windows
curl -OJ "url/{M%C3%A9di%C3%A1.jfif,simple.txt}"
The -J flag reads the filename from the server's Content-Disposition header. However, curl on Windows fails with "Invalid argument" when the header contains non-ASCII characters (diacritics, CJK, etc.).
Solution
Use separate -o "filename" "url" pairs for each file:
In DSpace 5, everything ran on one port (8080).
In DSpace 7+, the system is split:Port 4000 (Frontend): Just a JavaScript (Angular) app. It doesn't have the files.Port 8080 (Backend): The REST API where the files actually live.
Why Browser works vs. curl fails
Browser: Loads the Frontend $\rightarrow$ Runs JavaScript $\rightarrow$ Automatically fetches the file from the Backend. Curl: Only downloads what is at the URL. Since the Frontend is just an "empty shell," you get 404 or HTML, because curl cannot run the JavaScript needed to find the actual file.
Find the "True" URLOpen Browser DevTools (F12) > Network tab.Refresh the page and find the request for the file.Use the Request URL found there (it will likely be port 8080).
Fix via Proxy (If port 4000 must work)If you need the frontend to serve these files, ensure the Express server is configured to proxy /bitstream requests to the backend:JavaScript// Example in Express
app.use('/bitstream', createProxyMiddleware({ target: 'http://localhost:8080' }));
Activity
Paurikova2 commentedon Feb 18, 2026
@milanmajchrak
He checked: curl -O <a href="https://dspace-dev.ufal.mff.cuni.cz/repository/server/api/bitstream/11234/1-5814%7B/0/pdtvallex-4.5.xml,/1/vallex.changes%22 rel="noreferrer noopener" title="https://dspace-dev.ufal.mff.cuni.cz/repository/server/api/bitstream/11234/1-5814%7b/0/pdtvallex-4.5.xml,/1/vallex.changes%22 target="_blank">https://dspace-dev.ufal.mff.cuni.cz/repository/server/api/bitstream/11234/1-5814{/0/pdtvallex-4.5.x…
I found item: https://dspace-dev.ufal.mff.cuni.cz/repository/items/34ed276a-fcb5-4199-b160-a3d20c79f8f6
Copied curl and it works for me. curl -O https://dspace-dev.ufal.mff.cuni.cz/repository/server/api/bitstream/11234/1-5814{/0/pdtvallex-4.5.xml,/1/vallex.changes}
Paurikova2 commentedon Feb 18, 2026
@milanmajchrak
THIS IS IMPORTANT
There is unexising url.
Correct url> http://localhost:4000/bitstream/123456789/2-5912/0/test.jfif
And now there is problem:
The Core Problem
In DSpace 5, everything ran on one port (8080).
In DSpace 7+, the system is split:Port 4000 (Frontend): Just a JavaScript (Angular) app. It doesn't have the files.Port 8080 (Backend): The REST API where the files actually live.
Why Browser works vs. curl fails
Browser: Loads the Frontend$\rightarrow$ Runs JavaScript $\rightarrow$ Automatically fetches the file from the Backend.
Curl: Only downloads what is at the URL. Since the Frontend is just an "empty shell," you get 404 or HTML, because curl cannot run the JavaScript needed to find the actual file.
Solutions for the next developer1.
app.use('/bitstream', createProxyMiddleware({ target: 'http://localhost:8080' }));
Maybe helpfull
dataquest-dev/DSpace#1048
fix: add bitstream download-by-handle endpoint for curl instructions
fix: generate correct curl download URLs using backend handle endpoint
UFAL/Fix: add bitstream download-by-handle endpoint for curl instruct…
UFAL/Release hotfix 2026 02 26 - Merge PR (#1260)
UFAL/Release hotfix 2026 02 26 - merge PR (#1225)
UFAL/Release 2026 july 02 (#1342)
UFAL/Release 2026 july 02 (#1351)
UFAL/Release 2026 July 14 (#1375)
UFAL/Release 2026 July 14 (#1366)