Filename contains invalid characters while uploading to IPFS

I’m getting this error each time I try to upload a PDF document which has an “&” character in the title.
If that character is not present everything works fine…

Uncaught (in promise) Error: Filename contains invalid characters.
    at handleError (moralis.js:26207:17)


Where in pathname is that character?

its in the name of the file like “me&you.pdf” for example…

With what function you upload it to IPFS? You could change that file name so that it doesn’t have special characters any more.

1 Like

great idea, thanks!
For the moment I fixed like this:

const data = input_image.files[0]
let name =, "Y");
const file = new Moralis.File(name, data)
await file.saveIPFS();
1 Like