Upload jpeg results in file starting with 0xef 0xbf

System Information
  • Strapi Version: 3.6.5
  • Operating System: debian
  • Database: sqllite
  • Node Version: 14
  • NPM Version: 6.14.12
  • Yarn Version: –

Gents,

I am using local upload to store images and noticed the images are uploaded but not readable because they start with

Now comparing the s3 upload plugin, i can see the following:

Buffer.from(file.buffer, 'binary'),

whereas in the local plugin:

          fs.writeFile(
            path.join(uploadDir, `/uploads/${file.hash}${file.ext}`),
            file.buffer,

Maybe there is a problem with just writing the buffer? On the other hand i guess i am not the first one to use it? I don’t know where to look for a solution, any help appreciated

Digging a bit more, it appears that the header is:

content-type: application/json; charset=utf-8

Really odd? Anyone experiencing a similar problem?