File downloading via REST with space in filename won't work

The request looks something like this:

Sending the request URL encoded or not makes no difference, it always throws a:

Invalid file reference: Cannot convert 's3://2021/09/14/b11111c6-e3de-6cd2-63dd-c5e355f9b1ee.pdf?name=file with space.pdf' into valid file reference

Removing the spaces from the name attribute solves the issue, but then we can’t use spaces in the filenames.


I’ve created an issue. Thank you for reporting.

1 Like

Although, maybe there is no issue here.

How did you get the FileRef string? It seems that even in plain FileRef the name part should already be encoded, that is not true for you case.

If you encode the fileRef string (that already has encoded name part) then everything should work.

It’s also the same behaviour when the space %20 is encoded with +.

My question was why your FileRef string contains not encoded name part (name=file with space.pdf)?

s3://2021/09/14/b11111c6-e3de-6cd2-63dd-c5e355f9b1ee.pdf?name=file with space.pdf

For example, when I upload the file called my file.docx, its FileRef string is

fs://2022/07/07/0cfbad56-99a6-a7c7-3432-f1c79832abc9.docx?name=my+file.docx (no space in the name)

After I encode it for using in download URL it looks like this:


The following URL works for me:

1 Like

Hm, yes. I could’ve sworn I tested that as well, but it looks like it’s working.

One thing though: when you download the file, you get a filename where every space is replaced by ‘+’.

Created another issue for this. Thank you.

1 Like