jeroen / mongolite

Fast and Simple MongoDB Client for R
https://jeroen.github.io/mongolite/
284 stars 64 forks source link

gridfs download with spaces in filename #204

Open dcaud opened 4 years ago

dcaud commented 4 years ago

I am trying to download a file that has spaces in the filename:

name.with.spaces <- "File name with space.zip"
fs$download(name.with.spaces, 'outputfiles')

I get this error:

Error: Parameter 'name' does not contain valid json or filename (no spaces)

I tried to format a query, but this doesn't work either:

formatted.query <- paste0('{"name" : "', name.with.spaces, '"}')
cat(formatted.query)
{"name" : "File name with space.zip"}
fs$download(formatted.query, 'outputfiles')

The above returns:

Error: File not found.

Any ideas? If you can just point me to the right part of the documentation, I would really appreciate it.