Issues on creating a custom upload provider

It turns out I can solve it with controller but not provider: