I am trying to upload files with accented filenames.
Example try:
curl -f -H "X-Dataverse-key:$API_KEY" -X POST -F "file=@\"Boldogság\"" -F '
jsonData={"filename": "Boldogs%C3%A1g"}' "$SERVER/api/datasets/:persistentId/add?persistentId=$PID"
This results in "Boldogság" as filename. If I leave the jsonData without urlencoding, the result is the same. If I use utf-8 escape sequences (like \045F), the result is the same.
I can easily rename the file on the user interface, but I would not like to do that to hundreds of files...
Interesting. You definitely want to use curl? I'm just wondering if pyDataverse handles this.
I will try pydataverse. Unfortunately, uploading big files with pydataverse is really slow and memory hungry, or - after 2GB - even impossible.
Maybe you could try DVUploader as well: https://guides.dataverse.org/en/6.10.1/user/dataset-management.html#command-line-dvuploader
To be clear, I'm wondering if there's a bug in the backend (Dataverse) or if we need add a flag or something to curl.
I triesd uploading with pydataverse, and the error is the same: all non-8bit UTF-8 characters are represented with two characters -- the two bytes for the actual UTF-8 characters interpreted in a different code page (iso-8859-1 maybe?). If this is not a bug in the backend, it seems at least an outdated default codepage for processing input.
How can the uploaded content's encoding be specified?
I also tried dvuploader, but it failed to upload the file with a 400 error (it connected good, and detected if the file MD5 existed before, and nothing was logged in the server logs). So it failed before the two other methods.
Boo. I'm calling for reinforcements. :sweat_smile:
@Péter Pallinger one more thing to try if you're willing! https://github.com/gdcc/python-dvuploader
python-dvuploader did upload the file, but the resulting file name was the same...
bah
I filed a bug report:
https://github.com/IQSS/dataverse/issues/12470
There is also a working workaround: You can rename the file after upload. But this is quite slow in case of many small files.
@Péter Pallinger thanks!
Last updated: Aug 18 2026 at 08:27 UTC