Modify .public folder for media library uploads

I have also tried setting a custom middleware config file in “config/middleware.js”

module.exports = {
     settings: {
         public: {
             path: './site',
        },
    },
 };

And know it uploads to the folder but after failst in the post /upload call